X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=fish%2Ffish.c;h=be8e8414492b08bd5d5964a77c295574e996bb0b;hb=74cd1b4a707f0e495f072476e9425b0218d2ab3e;hp=c1dbfb4d5de8c3bc4a5326c588f8230e08a3fdc9;hpb=70faafe8d4f0c06c3e62c1e1469289255ee30c53;p=libguestfs.git diff --git a/fish/fish.c b/fish/fish.c index c1dbfb4..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 <