Commits

Jan Borsodi committed b1ac4da

Verbosity can now be turned on with -v as well as --verbose if argparse >= 1.1 is used.

Comments (0)

Files changed (1)

 import os
 from copy import copy
 import shutil
+from distutils.version import LooseVersion as Version
 
 from hob.proto import OperaValidator, ValidationError, PackageManager, ErrorType, iterTree, Config, ConfigError, Target, defaultPath
 from hob.template import TextGenerator
     "pdb": False,
 }
 
+# If we have argparse >= 1.1 then we also allow -v for verbose option
+_short_verbose = ''
+if Version(argparse.__version__) >= '1.1':
+    _short_verbose = 'v'
+
 global_options = [
-    ('', 'verbose', False,
+    (_short_verbose, 'verbose', False,
      _('increase verbosity')),
     ('', 'quiet', False,
      _('be silent')),
     ui.config.reads("[hob]\ntarget=current\n")
     _exts.setup(ui, cmds)
     parser_args = dict(prog=__program__)
-    from distutils.version import LooseVersion as Version
     if Version(argparse.__version__) < "1.1":
         parser_args["version"] = __version__
     parser = argparse.ArgumentParser(**parser_args)