+static int run_ntfs_3g_probe (const char *cmd, int argc, char *argv[])
+{
+ int r;
+ int rw;
+ const char *device;
+ if (argc != 2) {
+ fprintf (stderr, "%s should have 2 parameter(s)\n", cmd);
+ fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd);
+ return -1;
+ }
+ rw = is_true (argv[0]) ? 1 : 0;
+ device = argv[1];
+ r = guestfs_ntfs_3g_probe (g, rw, device);
+ if (r == -1) return -1;
+ printf ("%d\n", r);
+ return 0;
+}
+
+static int run_sh (const char *cmd, int argc, char *argv[])
+{
+ char *r;
+ const char *command;
+ if (argc != 1) {
+ fprintf (stderr, "%s should have 1 parameter(s)\n", cmd);
+ fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd);
+ return -1;
+ }
+ command = argv[0];
+ r = guestfs_sh (g, command);
+ if (r == NULL) return -1;
+ printf ("%s\n", r);
+ free (r);
+ return 0;
+}
+
+static int run_sh_lines (const char *cmd, int argc, char *argv[])
+{
+ char **r;
+ const char *command;
+ if (argc != 1) {
+ fprintf (stderr, "%s should have 1 parameter(s)\n", cmd);
+ fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd);
+ return -1;
+ }
+ command = argv[0];
+ r = guestfs_sh_lines (g, command);
+ if (r == NULL) return -1;
+ print_strings (r);
+ free_strings (r);
+ return 0;
+}
+
+static int run_glob_expand (const char *cmd, int argc, char *argv[])
+{
+ char **r;
+ const char *pattern;
+ if (argc != 1) {
+ fprintf (stderr, "%s should have 1 parameter(s)\n", cmd);
+ fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd);
+ return -1;
+ }
+ pattern = argv[0];
+ r = guestfs_glob_expand (g, pattern);
+ if (r == NULL) return -1;
+ print_strings (r);
+ free_strings (r);
+ return 0;
+}
+