|
@@ -57,13 +57,13 @@ COMMANDTYPES getCommand(char *str, unsigned int isshort) {
|
|
|
}
|
|
|
|
|
|
void show_help(char *exec) {
|
|
|
- printf("ccats command line interface\n");
|
|
|
- printf("usage: %s COMMAND IP [Options]\n", exec);
|
|
|
- printf("available COMMANDs are:\n");
|
|
|
+ std::printf("ccats command line interface\n");
|
|
|
+ std::printf("usage: %s COMMAND IP [Options]\n", exec);
|
|
|
+ std::printf("available COMMANDs are:\n");
|
|
|
for(int i = 0; i < sizeofarr(commands); i++) {
|
|
|
- printf("%10s - %s\n", commands[i].name, commands[i].desc);
|
|
|
+ std::printf("%10s - %s\n", commands[i].name, commands[i].desc);
|
|
|
}
|
|
|
- printf("IP should be in the format \"xxx.xxx.xxx.xxx\"\n");
|
|
|
+ std::printf("IP should be in the format \"xxx.xxx.xxx.xxx\"\n");
|
|
|
}
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
@@ -80,7 +80,7 @@ int main(int argc, char **argv) {
|
|
|
COMMANDTYPES cmd = getCommand(argv[1], (strlen(argv[1]) == 1));
|
|
|
switch(cmd) {
|
|
|
case CMD_UNKNOWN:
|
|
|
- printf("unknown command\n");
|
|
|
+ std::printf("unknown command\n");
|
|
|
case CMD_HELP:
|
|
|
show_help(argv[0]);
|
|
|
std::cout << desc;
|
|
@@ -90,13 +90,13 @@ int main(int argc, char **argv) {
|
|
|
|
|
|
switch(cmd) {
|
|
|
case CMD_CONNECT:
|
|
|
- printf("connecting to %s\n", argv[2]);
|
|
|
+ std::printf("connecting to %s\n", argv[2]);
|
|
|
break;
|
|
|
case CMD_DISCONNECT:
|
|
|
- printf("disconnecting from %s\n", argv[2]);
|
|
|
+ std::printf("disconnecting from %s\n", argv[2]);
|
|
|
break;
|
|
|
default:
|
|
|
- printf("command %s not implemented\n", argv[1]);
|
|
|
+ std::printf("command %s not implemented\n", argv[1]);
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -108,10 +108,10 @@ int main(int argc, char **argv) {
|
|
|
std::cout << desc;
|
|
|
}
|
|
|
else {
|
|
|
- printf("no additional options\n");
|
|
|
+ std::printf("no additional options\n");
|
|
|
}
|
|
|
}
|
|
|
catch (const bpo::error &ex) {
|
|
|
- fprintf(stderr, "%s\n", ex.what());
|
|
|
+ std::fprintf(stderr, "%s\n", ex.what());
|
|
|
}
|
|
|
}
|