X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ffish.c;h=557a6ac948a3bdcfb0a319155cd2249df8d4a7d8;hb=6b500f1b8e1ac8d28c485a5591c2833b18cc86e2;hp=a630cdcaba7a8ea3abffc02a4489115fd0e7a77e;hpb=11a2ad8c9a1da7fe7f8142be69312d0cb5979e0a;p=libguestfs.git diff --git a/fish/fish.c b/fish/fish.c index a630cdc..557a6ac 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -65,7 +65,9 @@ static void script (int prompt); static void cmdline (char *argv[], int optind, int argc); static void initialize_readline (void); static void cleanup_readline (void); +#ifdef HAVE_LIBREADLINE static void add_history_line (const char *); +#endif static void print_shell_quote (FILE *stream, const char *str); /* Currently open libguestfs handle. */ @@ -990,6 +992,8 @@ issue_command (const char *cmd, char *argv[], const char *pipecmd) r = do_reopen (cmd, argc, argv); else if (STRCASEEQ (cmd, "sparse")) r = do_sparse (cmd, argc, argv); + else if (STRCASEEQ (cmd, "supported")) + r = do_supported (cmd, argc, argv); else if (STRCASEEQ (cmd, "time")) r = do_time (cmd, argc, argv); else @@ -1047,6 +1051,8 @@ list_builtin_commands (void) printf ("%-20s %s\n", "sparse", _("allocate a sparse image file")); printf ("%-20s %s\n", + "supported", _("list supported groups of commands")); + printf ("%-20s %s\n", "time", _("measure time taken to run command")); /* actions are printed after this (see list_commands) */ @@ -1067,16 +1073,8 @@ display_builtin_command (const char *cmd) "\n" " For more advanced image creation, see qemu-img utility.\n" "\n" - " Size can be specified (where means a number):\n" - " number of kilobytes\n" - " eg: 1440 standard 3.5\" floppy\n" - " K or KB number of kilobytes\n" - " M or MB number of megabytes\n" - " G or GB number of gigabytes\n" - " T or TB number of terabytes\n" - " P or PB number of petabytes\n" - " E or EB number of exabytes\n" - " sects number of 512 byte sectors\n")); + " Size can be specified using standard suffixes, eg. '1M'.\n" + )); else if (STRCASEEQ (cmd, "echo")) printf (_("echo - display a line of text\n" " echo [ ...]\n" @@ -1091,7 +1089,7 @@ display_builtin_command (const char *cmd) " This is used to edit a file.\n" "\n" " It is the equivalent of (and is implemented by)\n" - " running \"cat\", editing locally, and then \"write-file\".\n" + " running \"cat\", editing locally, and then \"write\".\n" "\n" " Normally it uses $EDITOR, but if you use the aliases\n" " \"vi\" or \"emacs\" you will get those editors.\n" @@ -1166,16 +1164,18 @@ display_builtin_command (const char *cmd) "\n" " For more advanced image creation, see qemu-img utility.\n" "\n" - " Size can be specified (where means a number):\n" - " number of kilobytes\n" - " eg: 1440 standard 3.5\" floppy\n" - " K or KB number of kilobytes\n" - " M or MB number of megabytes\n" - " G or GB number of gigabytes\n" - " T or TB number of terabytes\n" - " P or PB number of petabytes\n" - " E or EB number of exabytes\n" - " sects number of 512 byte sectors\n")); + " Size can be specified using standard suffixes, eg. '1M'.\n" + )); + else if (STRCASEEQ (cmd, "supported")) + printf (_("supported - list supported groups of commands\n" + " supported\n" + "\n" + " This command returns a list of the optional groups\n" + " known to the daemon, and indicates which ones are\n" + " supported by this build of the libguestfs appliance.\n" + "\n" + " See also guestfs(3) section AVAILABILITY.\n" + )); else if (STRCASEEQ (cmd, "time")) printf (_("time - measure time taken to run command\n" " time [ ...]\n" @@ -1417,6 +1417,13 @@ initialize_readline (void) rl_readline_name = "guestfish"; rl_attempted_completion_function = do_completion; + + /* Note that .inputrc (or /etc/inputrc) is not read until the first + * call the readline(), which happens later. Therefore, these + * provide default values which can be overridden by the user if + * they wish. + */ + (void) rl_variable_bind ("completion-ignore-case", "on"); #endif } @@ -1443,14 +1450,14 @@ cleanup_readline (void) #endif } +#ifdef HAVE_LIBREADLINE static void add_history_line (const char *line) { -#ifdef HAVE_LIBREADLINE add_history (line); nr_history_lines++; -#endif } +#endif int xwrite (int fd, const void *v_buf, size_t len)