-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.cpp
37 lines (32 loc) · 810 Bytes
/
main.cpp
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
#include "stdafx.h"
#include "any-ticker.h"
#include "file_convert.h"
using namespace std;
/* for errors */
int debugFlag = 0;
int errorNum = 0;
void help( void);
int main( int argc, char *argv[]){
if( argc == 1){
cout << "No command detected" << endl;
help();
}else if( argc > 1){
if( strcmp( argv[1], "ticker") == 0){
any_ticker( argc-1, argv+1);
}else if( strcmp( argv[1], "help") == 0){
help();
}else if( strcmp( argv[1], "convert") == 0){
file_convert( argc-1, argv+1);
}else{
cout << "Error: No command \"" << argv[1] << "\""<< endl;
}
}
return 0;
}
void help( void){
cout << "Usage" << endl;
cout << "Command list:" << endl;
cout << "ticker - make a ticker message" << endl;
cout << "help - show this text" << endl;
cout << "convert - file conversion" << endl;
}