diff options
author | Lingchao Xin <lingchaox.xin@intel.com> | 2014-01-02 15:07:45 +0800 |
---|---|---|
committer | Lingchao Xin <lingchaox.xin@intel.com> | 2014-01-02 15:07:58 +0800 |
commit | 52d3953a89cd6492e954b2f6552a8b7fa45f6ddf (patch) | |
tree | d8ca3d825de292b2288dd8743e976804f7e88f0d | |
parent | 2c672a4532e7239b55d8cd79214f1b3c370d5b55 (diff) | |
download | python-snapdiff-52d3953a89cd6492e954b2f6552a8b7fa45f6ddf.tar.gz python-snapdiff-52d3953a89cd6492e954b2f6552a8b7fa45f6ddf.tar.bz2 python-snapdiff-52d3953a89cd6492e954b2f6552a8b7fa45f6ddf.zip |
Fix argparse mutually exclusive group members
Change-Id: Id404ff577d1c09ed0f475ecd1d17342b0407f482
-rwxr-xr-x | tools/snap-diff | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/snap-diff b/tools/snap-diff index a5f4c0b..5dd6013 100755 --- a/tools/snap-diff +++ b/tools/snap-diff @@ -11,14 +11,14 @@ def main(argv): parser = argparse.ArgumentParser(description=description) parser.add_argument(dest='old', help='old repo') parser.add_argument(dest='new', help='new repo') - parser.add_argument('--json', help='output json diffs', action='store_true') + parser.add_argument('-t', dest='type', default='repo', help="which diff you want(repo | image, default is repo)") group = parser.add_mutually_exclusive_group() - group.add_argument('-t', dest='type', default='repo', help="which diff you want(repo | image, default is repo)") + group.add_argument('--json', help='output json diffs', action='store_true') group.add_argument('-d', dest='directory', help="Output html diffs into the directory") args = parser.parse_args(argv) if args.directory: - snapdiff.diff_to_dist(args.old, args.new, args.directory, style=args.type or 'repo') + snapdiff.diff_to_dist(args.old, args.new, args.directory, style=args.type) print "Diff between '%s' and '%s' has been ready in %s" % (args.old, args.new, args.directory) elif args.json: print snapdiff.diff_to_JSON(args.old, args.new, style=args.type) |