X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ffish.c;h=a36ec09afa8017eab2a6dfb0b6826d0fd6fa4714;hb=00fae9fe88ca83dfc3ee0b1b7d8e27e644f6e9c7;hp=4a7e70b82fdacbe04e49f150844cda7f40956c76;hpb=4a9b979a3199dfef64a342f05d666da540203a7c;p=libguestfs.git diff --git a/fish/fish.c b/fish/fish.c index 4a7e70b..a36ec09 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -550,7 +550,8 @@ prepare_drives (struct drv *drv) { if (drv) { prepare_drives (drv->next); - prepare_drive (drv->filename, drv->data, drv->device); + if (drv->data) + prepare_drive (drv->filename, drv->data, drv->device); } } @@ -621,7 +622,8 @@ script (int prompt) "Welcome to guestfish, the libguestfs filesystem interactive shell for\n" "editing virtual machine filesystems.\n" "\n" - "Type: 'help' for help with commands\n" + "Type: 'help' for a list of commands\n" + " 'man' to read the manual\n" " 'quit' to quit the shell\n" "\n")); @@ -942,6 +944,9 @@ issue_command (const char *cmd, char *argv[], const char *pipecmd) r = do_lcd (cmd, argc, argv); else if (STRCASEEQ (cmd, "glob")) r = do_glob (cmd, argc, argv); + else if (STRCASEEQ (cmd, "man") || + STRCASEEQ (cmd, "manual")) + r = do_man (cmd, argc, argv); else if (STRCASEEQ (cmd, "more") || STRCASEEQ (cmd, "less")) r = do_more (cmd, argc, argv); @@ -981,10 +986,12 @@ issue_command (const char *cmd, char *argv[], const char *pipecmd) void list_builtin_commands (void) { - /* help and quit should appear at the top */ + /* help, man and quit should appear at the top */ printf ("%-20s %s\n", "help", _("display a list of commands or help on a command")); printf ("%-20s %s\n", + "man", _("read the manual")); + printf ("%-20s %s\n", "quit", _("quit guestfish")); printf ("%-20s %s\n", @@ -1069,6 +1076,12 @@ display_builtin_command (const char *cmd) " Glob runs with wildcards expanded in any\n" " command args. Note that the command is run repeatedly\n" " once for each expanded argument.\n")); + else if (STRCASEEQ (cmd, "man") || + STRCASEEQ (cmd, "manual")) + printf (_("man - read the manual\n" + " man\n" + "\n" + " Opens the manual page for guestfish.\n")); else if (STRCASEEQ (cmd, "help")) printf (_("help - display a list of commands or help on a command\n" " help cmd\n"