From: Yu Zhiguo <yuzg@cn.fujitsu.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH] xenstore: Fix the method of get options and the usage
Date: Fri, 18 Dec 2009 14:41:09 +0800 [thread overview]
Message-ID: <4B2B2405.7090102@cn.fujitsu.com> (raw)
Add long option '--flat' correspond to short option '-f',
and let it just can be used for subcommand 'ls' (because
in fact it's useless for subcommand 'read' and 'list').
And fix the usage of subcommands 'ls', 'list' and 'chmod'.
Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c
+++ b/tools/xenstore/xenstore_client.c
@@ -88,13 +88,13 @@
mstr = incl_mode ? "exists " : "";
case MODE_list:
mstr = mstr ? : incl_mode ? "list " : "";
- errx(1, "Usage: %s %s[-h] [-s] key [...]", progname, mstr);
+ errx(1, "Usage: %s %s[-h] [-p] [-s] key [...]", progname, mstr);
case MODE_ls:
mstr = mstr ? : incl_mode ? "ls " : "";
- errx(1, "Usage: %s %s[-h] [-s] [path]", progname, mstr);
+ errx(1, "Usage: %s %s[-h] [-f] [-p] [-s] [path]", progname, mstr);
case MODE_chmod:
mstr = incl_mode ? "chmod " : "";
- errx(1, "Usage: %s %s[-h] [-s] key <mode [modes...]>", progname, mstr);
+ errx(1, "Usage: %s %s[-h] [-u] [-r] [-s] key <mode [modes...]>", progname, mstr);
}
}
@@ -492,15 +492,16 @@
int c, index = 0;
static struct option long_options[] = {
{"help", 0, 0, 'h'},
+ {"flat", 0, 0, 'f'}, /* MODE_ls */
{"socket", 0, 0, 's'},
- {"prefix", 0, 0, 'p'}, /* MODE_read || MODE_list */
+ {"prefix", 0, 0, 'p'}, /* MODE_read || MODE_list || MODE_ls */
{"tidy", 0, 0, 't'}, /* MODE_rm */
{"upto", 0, 0, 'u'}, /* MODE_chmod */
{"recurse", 0, 0, 'r'}, /* MODE_chmod */
{0, 0, 0, 0}
};
- c = getopt_long(argc - switch_argv, argv + switch_argv, "fhsptur",
+ c = getopt_long(argc - switch_argv, argv + switch_argv, "hfsptur",
long_options, &index);
if (c == -1)
break;
@@ -510,7 +511,7 @@
usage(mode, switch_argv, argv[0]);
/* NOTREACHED */
case 'f':
- if ( mode == MODE_read || mode == MODE_list || mode == MODE_ls ) {
+ if ( mode == MODE_ls ) {
max_width = INT_MAX/2;
desired_width = 0;
show_whole_path = 1;
reply other threads:[~2009-12-18 6:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B2B2405.7090102@cn.fujitsu.com \
--to=yuzg@cn.fujitsu.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.