diff options
author | Aaron LI <aly@aaronly.me> | 2018-01-20 00:10:03 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-01-20 00:10:03 +0800 |
commit | cecc2288b47699ad101142c73d959a719667dd0c (patch) | |
tree | e63f204373ccf24cd0d038a092cf97f9767eb973 | |
parent | 98f85ee94baaec79747c059cf86c92130459530a (diff) | |
download | fg21sim-cecc2288b47699ad101142c73d959a719667dd0c.tar.bz2 |
bin/fg21sim: add --version argument, and log version information
-rwxr-xr-x | bin/fg21sim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/fg21sim b/bin/fg21sim index cce91dc..052c50e 100755 --- a/bin/fg21sim +++ b/bin/fg21sim @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- mode: python -*- # -# Copyright (c) 2016-2017 Weitian LI <weitian@aaronly.me> +# Copyright (c) 2016-2018 Weitian LI <weitian@aaronly.me> # MIT license """ @@ -14,6 +14,7 @@ import argparse import logging import time +import fg21sim from fg21sim.share import CONFIGS, COSMO from fg21sim.utils import setup_logging @@ -23,6 +24,8 @@ def main(): description="Simulate the radio foregrounds for 21cm EoR signal", epilog="Set environment variable 'DEBUG_FG21SIM=1' to force debug!") parser.add_argument("config", help="user configuration file") + parser.add_argument("-v", "--version", action="version", + version="%(prog)s: version "+fg21sim.__version__) parser.add_argument("-l", "--log", dest="loglevel", default=None, choices=["debug", "info", "warning", "error", "critical"], @@ -49,6 +52,7 @@ def main(): logfile=args.logfile) tool = os.path.basename(sys.argv[0]) logger = logging.getLogger(tool) + logger.info("FG21sim: version %s" % fg21sim.__version__) logger.info("COMMAND: {0}".format(" ".join(sys.argv))) # Save/backup current configurations |