diff options
author | Aaron LI <aly@aaronly.me> | 2018-01-20 16:09:31 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-01-20 16:09:31 +0800 |
commit | 4bd6e407a8a8665cb9db028d0fc57eac86ff6f18 (patch) | |
tree | 9aa5d35a6c2c425888967f0f1fcd57010d540557 /bin/fg21sim | |
parent | 6e4b0378f9bb1d67ffbda397f1a0e351f6643500 (diff) | |
download | fg21sim-4bd6e407a8a8665cb9db028d0fc57eac86ff6f18.tar.bz2 |
bin/fg21sim: better report the version info with release date
Diffstat (limited to 'bin/fg21sim')
-rwxr-xr-x | bin/fg21sim | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/fg21sim b/bin/fg21sim index 052c50e..cf44efa 100755 --- a/bin/fg21sim +++ b/bin/fg21sim @@ -18,14 +18,19 @@ import fg21sim from fg21sim.share import CONFIGS, COSMO from fg21sim.utils import setup_logging +VER_INFO = "%(name)s: v%(version)s @ %(date)s" % { + "name": fg21sim.__pkgname__, + "version": fg21sim.__version__, + "date": fg21sim.__date__ +} + def main(): parser = argparse.ArgumentParser( 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("-v", "--version", action="version", version=VER_INFO) parser.add_argument("-l", "--log", dest="loglevel", default=None, choices=["debug", "info", "warning", "error", "critical"], @@ -52,7 +57,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(VER_INFO) logger.info("COMMAND: {0}".format(" ".join(sys.argv))) # Save/backup current configurations |