Add --list-commands option to the snapshot command
[lttng-tools.git] / src / bin / lttng / lttng.c
index 5755db6379daa5466cd1542a6709bfb97318e724..dc9dd9241b9847eb12466fefdefa8120314321ad 100644 (file)
@@ -150,25 +150,6 @@ static void list_options(FILE *ofp)
        }
 }
 
-/*
- *  list_commands
- *
- *  List commands line by line. This is mostly for bash auto completion and to
- *  avoid difficult parsing.
- */
-static void list_commands(FILE *ofp)
-{
-       int i = 0;
-       struct cmd_struct *cmd = NULL;
-
-       cmd = &commands[i];
-       while (cmd->name != NULL) {
-               fprintf(ofp, "%s\n", cmd->name);
-               i++;
-               cmd = &commands[i];
-       }
-}
-
 /*
  * clean_exit
  */
@@ -466,7 +447,7 @@ static int parse_args(int argc, char **argv)
                        ret = 0;
                        goto end;
                case OPT_DUMP_COMMANDS:
-                       list_commands(stdout);
+                       list_commands(commands, stdout);
                        ret = 0;
                        goto end;
                default:
This page took 0.023066 seconds and 4 git commands to generate.