Add unsupported error code to lttng cmd line
[lttng-tools.git] / src / bin / lttng / lttng.c
index f41e9767dcf20240e5809d4f179c71e042412a87..113f69d9ba065e874ded90d555ffb9452ebe9cdf 100644 (file)
@@ -82,7 +82,7 @@ static struct cmd_struct commands[] =  {
 static void usage(FILE *ofp)
 {
        fprintf(ofp, "LTTng Trace Control " VERSION" - " VERSION_NAME"\n\n");
-       fprintf(ofp, "usage: lttng [OPTIONS] <COMMAND>\n");
+       fprintf(ofp, "usage: lttng [OPTIONS] <COMMAND> [<ARGS>]\n");
        fprintf(ofp, "\n");
        fprintf(ofp, "Options:\n");
        fprintf(ofp, "  -h, --help                 Show this help\n");
@@ -274,7 +274,7 @@ static int handle_command(int argc, char **argv)
        }
 
        /* Command not found */
-       ret = -1;
+       ret = CMD_UNDEFINED;
 
 end:
        return ret;
@@ -498,6 +498,9 @@ static int parse_args(int argc, char **argv)
        case CMD_FATAL:
                ERR("Fatal error");
                break;
+       case CMD_UNSUPPORTED:
+               ERR("Unsupported command");
+               break;
        case -1:
                usage(stderr);
                ret = 1;
This page took 0.024268 seconds and 4 git commands to generate.