From 0c0b313ef9bb6dda7c2deda8db713545278dec06 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 13 Feb 2017 21:26:37 +0800 Subject: manifest.py: Add argument "-C" / "--directory" --- scripts/manifest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/manifest.py b/scripts/manifest.py index 7ca8695..4555714 100755 --- a/scripts/manifest.py +++ b/scripts/manifest.py @@ -237,6 +237,8 @@ def main(description="Manage the observation manifest (YAML format)", help="Manifest file (default: %s)" % default_file) parser.add_argument("-b", "--brief", dest="brief", action="store_true", help="Be brief") + parser.add_argument("-C", "--directory", dest="directory", + help="Change to the given directory at first") subparsers = parser.add_subparsers(dest="cmd_name", title="sub-commands", help="additional help") @@ -273,6 +275,9 @@ def main(description="Manage the observation manifest (YAML format)", # args = parser.parse_args() + if args.directory: + os.chdir(args.directory) + if os.path.exists(args.file): manifest_file = args.file else: -- cgit v1.2.2