Skip to content

Commit

Permalink
Merge pull request #1134 from davidlatwe/cli-detailed-version-info
Browse files Browse the repository at this point in the history
CLI: display detailed version info with --version
  • Loading branch information
nerdvegas authored Oct 12, 2021
2 parents cf22bcc + 432cf57 commit 798f1d2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/rez/cli/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from rez.cli._util import subcommands, LazyArgumentParser, _env_var_true
from rez.utils.logging_ import print_error
from rez.exceptions import RezError, RezSystemError, _NeverError
from rez import __version__
from rez import __version__, module_root_path


# true if command was like 'rez-env' rather than 'rez env'
Expand Down Expand Up @@ -84,12 +84,15 @@ def setup_parser():
Returns:
LazyArgumentParser: Argument parser for rez command.
"""
py = sys.version_info
parser = LazyArgumentParser("rez")

parser.add_argument("-i", "--info", action=InfoAction,
help="print information about rez and exit")
parser.add_argument("-V", "--version", action="version",
version="Rez %s" % __version__)
version="Rez %s from %s (python %d.%d)" % (
__version__, module_root_path, py.major, py.minor
))

# add args common to all subcommands... we add them both to the top parser,
# AND to the subparsers, for two reasons:
Expand Down

0 comments on commit 798f1d2

Please sign in to comment.