diff options
author | Aaron LI <aaronly.me@outlook.com> | 2017-02-13 21:26:37 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2017-02-13 21:26:37 +0800 |
commit | 0c0b313ef9bb6dda7c2deda8db713545278dec06 (patch) | |
tree | 3d1eb85a3f505a870e2c33f5b34733d725bc5116 | |
parent | c54215fc774f86c0bf5065c2e861fbabfa625918 (diff) | |
download | chandra-acis-analysis-0c0b313ef9bb6dda7c2deda8db713545278dec06.tar.bz2 |
manifest.py: Add argument "-C" / "--directory"
-rwxr-xr-x | scripts/manifest.py | 5 |
1 files changed, 5 insertions, 0 deletions
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: |