X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ffish.c;h=be8e8414492b08bd5d5964a77c295574e996bb0b;hb=df4dce74a887e013a6aec51e241a90cfb7d3b36a;hp=50340a35adba02a1c3d2ef297dd35ee8df2e5289;hpb=272b754093ef824486993540a893d39be8e7e9f0;p=libguestfs.git diff --git a/fish/fish.c b/fish/fish.c index 50340a3..be8e841 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -45,6 +45,14 @@ #include "closeout.h" #include "progname.h" +/* Return from parse_command_line. See description below. */ +struct parsed_command { + int status; + char *pipe; + char *cmd; + char *argv[64]; +}; + static void set_up_terminal (void); static void prepare_drives (struct drv *drv); static int launch (void); @@ -52,6 +60,7 @@ static void interactive (void); static void shell_script (void); static void script (int prompt); static void cmdline (char *argv[], int optind, int argc); +static struct parsed_command parse_command_line (char *buf, int *exit_on_error_rtn); static void initialize_readline (void); static void cleanup_readline (void); #ifdef HAVE_LIBREADLINE @@ -69,7 +78,6 @@ int verbose = 0; int remote_control_listen = 0; int remote_control_csh = 0; int remote_control = 0; -int exit_on_error = 1; int command_num = 0; int keys_from_stdin = 0; int echo_keys = 0; @@ -89,18 +97,9 @@ usage (int status) fprintf (stdout, _("%s: guest filesystem shell\n" "%s lets you edit virtual machine filesystems\n" - "Copyright (C) 2009-2010 Red Hat Inc.\n" + "Copyright (C) 2009-2011 Red Hat Inc.\n" "Usage:\n" " %s [--options] cmd [: cmd : cmd ...]\n" - " %s [--ro] -i -a disk-image\n" - " %s [--ro] -i -d libvirt-domain\n" - "or for interactive use:\n" - " %s\n" - "or from a shell script:\n" - " %s <