X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=fish%2Fcmds.c;h=a3a1d0fc957a5f6da0545741d6f03bfdbea13058;hp=d0ab20c7f123827c8b6b76586fc9f297672c2066;hb=76f3ea8fb3318966c376bc6fbccbd5a81a9ec564;hpb=4567839859befc5aa9e1eee942dc2ba0701516e2 diff --git a/fish/cmds.c b/fish/cmds.c index d0ab20c..a3a1d0f 100644 --- a/fish/cmds.c +++ b/fish/cmds.c @@ -27,7 +27,8 @@ void list_commands (void) { - printf ("%-20s %s\n", "Command", "Description"); + printf (" %-16s %s\n", "Command", "Description"); + list_builtin_commands (); printf ("%-20s %s\n", "mount", "Mount a guest disk at a position in the filesystem"); printf ("%-20s %s\n", "sync", "Sync disks, writes are flushed through to the disk image"); printf ("%-20s %s\n", "touch", "Update file timestamps or create a new file"); @@ -45,9 +46,24 @@ void display_command (const char *cmd) if (strcasecmp (cmd, "touch") == 0) pod2text ("touch - Update file timestamps or create a new file", " touch \n\nTouch acts like the L command. It can be used to\nupdate the timestamps on a file, or, if the file does not exist,\nto create a new zero-length file."); else - { - fprintf (stderr, "%s: command not known, use -h to list all commands\n", cmd); - exit (1); - } + display_builtin_command (cmd); +} + +int run_action (const char *cmd, int argc, char *argv[]) +{ + if (strcasecmp (cmd, "mount") == 0) + printf ("running mount ...\n"); + else + if (strcasecmp (cmd, "sync") == 0) + printf ("running sync ...\n"); + else + if (strcasecmp (cmd, "touch") == 0) + printf ("running touch ...\n"); + else + { + fprintf (stderr, "%s: unknown command\n", cmd); + return -1; + } + return 0; }