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. */
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
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) */
"\n"
" For more advanced image creation, see qemu-img utility.\n"
"\n"
- " Size can be specified (where <nn> means a number):\n"
- " <nn> number of kilobytes\n"
- " eg: 1440 standard 3.5\" floppy\n"
- " <nn>K or <nn>KB number of kilobytes\n"
- " <nn>M or <nn>MB number of megabytes\n"
- " <nn>G or <nn>GB number of gigabytes\n"
- " <nn>T or <nn>TB number of terabytes\n"
- " <nn>P or <nn>PB number of petabytes\n"
- " <nn>E or <nn>EB number of exabytes\n"
- " <nn>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 [<params> ...]\n"
" 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"
"\n"
" For more advanced image creation, see qemu-img utility.\n"
"\n"
- " Size can be specified (where <nn> means a number):\n"
- " <nn> number of kilobytes\n"
- " eg: 1440 standard 3.5\" floppy\n"
- " <nn>K or <nn>KB number of kilobytes\n"
- " <nn>M or <nn>MB number of megabytes\n"
- " <nn>G or <nn>GB number of gigabytes\n"
- " <nn>T or <nn>TB number of terabytes\n"
- " <nn>P or <nn>PB number of petabytes\n"
- " <nn>E or <nn>EB number of exabytes\n"
- " <nn>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 <command> [<args> ...]\n"
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
}
#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)