File: main.cpp

package info (click to toggle)
piler 0~20140707-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 360 kB
  • sloc: cpp: 5,369; makefile: 39
file content (87 lines) | stat: -rwxr-xr-x 1,447 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include "piler2.h"

#if	WIN32
#include <windows.h>
#endif

bool g_Quiet = false;
const char *g_ProcessName = "piler2";

int main(int argc, char *argv[])
	{
	g_ProcessName = argv[0];

#if	WIN32
// Multi-tasking does not work well in CPU-bound
// console apps running under Win32.
// Reducing the process priority allows GUI apps
// to run responsively in parallel.
	SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS);
#endif

	ProcessArgVect(argc - 1, argv + 1);
	SetLog();
	g_Quiet = FlagOpt("quiet");

	for (int i = 0; i < argc; ++i)
		Log("%s ", argv[i]);
	Log("\n");

	if (ValueOpt("trs") != 0)
		{
		TRS();
		return 0;
		}
	else if (ValueOpt("tan") != 0)
		{
		Tan();
		return 0;
		}
	else if (ValueOpt("tr") != 0)
		{
		TR();
		return 0;
		}
	else if (ValueOpt("trs2fasta"))
		{
		TRS2Fasta();
		return 0;
		}
	else if (ValueOpt("tanmotif2fasta"))
		{
		Tanmotif2Fasta();
		return 0;
		}
	else if (ValueOpt("cons"))
		{
		Cons();
		return 0;
		}
	else if (ValueOpt("annot"))
		{
		Annot();
		return 0;
		}
	else if (ValueOpt("annotedge"))
		{
		AnnotEdge();
		return 0;
		}
	else if (ValueOpt("crisp"))
		{
		Crisp();
		return 0;
		}
	else if (FlagOpt("help"))
		{
		Usage();
		exit(0);
		}
	else if (FlagOpt("version"))
		{
		fprintf(stderr, PILER_LONG_VERSION "\n");
		exit(0);
		}
	else
		CommandLineError("No command specified");
 	}