From 4bd6e407a8a8665cb9db028d0fc57eac86ff6f18 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 20 Jan 2018 16:09:31 +0800 Subject: bin/fg21sim: better report the version info with release date --- bin/fg21sim | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'bin/fg21sim') 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 -- cgit v1.2.2