support -V, --version

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
remotes/origin/feature_files_export
Nico Schottelius 13 years ago
parent 1cc7600c9c
commit 5260f230e5
  1. 7
      bin/cdist

@ -100,6 +100,7 @@ class Cdist:
self.base_dir = home
else:
self.base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
self.conf_dir = os.path.join(self.base_dir, "conf")
self.global_explorer_dir = os.path.join(self.conf_dir, "explorer")
self.lib_dir = os.path.join(self.base_dir, "lib")
@ -611,10 +612,16 @@ if __name__ == "__main__":
# help='Operate on multiple hosts sequentially',
# action='store_false', dest='parallel')
parser.add_argument('-V', '--version', help='Show version',
action='version', version='%(prog)s ' + VERSION)
args = parser.parse_args(sys.argv[1:])
if args.debug:
logging.root.setLevel(logging.DEBUG)
print(args)
sys.exit(1)
if args.banner:
banner()
sys.exit(0)

Loading…
Cancel
Save