# HG changeset patch # User Iannis # Date 1488200915 -7200 # Node ID c7e64cfab199865b875e25b58ccc4f1b2c0130b3 # Parent 51b799247d67455d6175e126104b0506671cb514 Show version in command line. diff -r 51b799247d67 -r c7e64cfab199 atmospheric_lidar/scripts/licel2scc.py --- a/atmospheric_lidar/scripts/licel2scc.py Sun Feb 26 22:30:27 2017 +0200 +++ b/atmospheric_lidar/scripts/licel2scc.py Mon Feb 27 15:08:35 2017 +0200 @@ -9,6 +9,7 @@ from ..licel import LicelLidarMeasurement +from ..__init__ import __version__ def create_custom_class(custom_netcdf_parameter_path, use_id_as_name=False, temperature=25., pressure=1020.): @@ -96,6 +97,7 @@ parser.add_argument('-s', '--silent', help="Show only warning and error messages.", action="store_const", dest="loglevel", const=logging.WARNING ) + parser.add_argument('--version', help="Show current version.", action='store_true') args = parser.parse_args() @@ -105,6 +107,10 @@ #coloredlogs.install(fmt='%(levelname)s: %(message)s', level=args.loglevel) + if args.version: + print("Version: %s" % __version__) + sys.exit(0) + # Get a list of files to convert search_str = os.path.join(args.directory, args.search_string) files = glob.glob(search_str) diff -r 51b799247d67 -r c7e64cfab199 atmospheric_lidar/scripts/licel2scc_depol.py --- a/atmospheric_lidar/scripts/licel2scc_depol.py Sun Feb 26 22:30:27 2017 +0200 +++ b/atmospheric_lidar/scripts/licel2scc_depol.py Mon Feb 27 15:08:35 2017 +0200 @@ -9,6 +9,7 @@ from ..licel_depol import LicelCalibrationMeasurement +from ..__init__ import __version__ def create_custom_class(custom_netcdf_parameter_path, use_id_as_name=False, temperature=25., pressure=1020.): @@ -95,6 +96,7 @@ parser.add_argument('-s', '--silent', help="Show only warning and error messages.", action="store_const", dest="loglevel", const=logging.WARNING ) + parser.add_argument('--version', help="Show current version.", action='store_true') args = parser.parse_args() @@ -104,6 +106,10 @@ #coloredlogs.install(fmt='%(levelname)s: %(message)s', level=args.loglevel) + if args.version: + print("Version: %s" % __version__) + sys.exit(0) + # Get a list of files to convert plus45_files = glob.glob(args.plus45_string) minus45_files = glob.glob(args.minus45_string)