WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xenstore: Fix the method of get options a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xenstore: Fix the method of get options and the usage
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 17 Dec 2009 23:55:20 -0800
Delivery-date: Thu, 17 Dec 2009 23:55:57 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1261122807 0
# Node ID 1a911fd65e52fe1a7fb40c797a603b867761264e
# Parent  26822073c426f8b087a264d8b5c532df6a1ca328
xenstore: Fix the method of get options and the usage

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@xxxxxxxxxxxxxx>
---
 tools/xenstore/xenstore_client.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff -r 26822073c426 -r 1a911fd65e52 tools/xenstore/xenstore_client.c
--- a/tools/xenstore/xenstore_client.c  Fri Dec 18 07:52:03 2009 +0000
+++ b/tools/xenstore/xenstore_client.c  Fri Dec 18 07:53:27 2009 +0000
@@ -88,13 +88,13 @@ usage(enum mode mode, int incl_mode, con
        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 @@ main(int argc, char **argv)
        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 @@ main(int argc, char **argv)
            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;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xenstore: Fix the method of get options and the usage, Xen patchbot-unstable <=