Skip to content

Commit

Permalink
Better version string for --help/--version output
Browse files Browse the repository at this point in the history
  • Loading branch information
glennmatthews committed Sep 2, 2014
1 parent 300f016 commit ed5d0d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions COT/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
# distributed except according to the terms contained in the LICENSE.txt file.

__version__ = "1.1.1"
__version_long__ = (
"""Common OVF Tool (COT), version """ + __version__ +
"""\nCopyright (C) 2013-2014 the COT project developers."""
)
9 changes: 4 additions & 5 deletions COT/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import os.path
import re

from COT import __version__
from COT import __version__, __version_long__

# In python 2.7, we want raw_input, but in python 3 we want input.
try: input = raw_input
Expand Down Expand Up @@ -130,11 +130,10 @@ def get_input(prompt, default, force=False):
# "\n %(prog)s --version"
# "\n %(prog)s <command> --help"
# "\n %(prog)s [-f] [-v] <command> <options>"),
description=("""Common OVF Tool (COT) {version}
description=(__version_long__ + """
A tool for editing Open Virtualization Format (.ovf, .ova) virtual appliances,
with a focus on virtualized network appliances such as the Cisco CSR 1000V and
Cisco IOS XRv platforms.
""".format(version=__version__)),
Cisco IOS XRv platforms."""),
epilog=(
"""Note: some subcommands rely on external software tools, including:
* vmdktool (http://www.freshports.org/sysutils/vmdktool/)
Expand All @@ -146,7 +145,7 @@ def get_input(prompt, default, force=False):
formatter_class=argparse.RawDescriptionHelpFormatter)

parser.add_argument('-V', '--version', action='version',
version="%(prog)s {version}".format(version=__version__))
version=__version_long__)
parser.add_argument('-f', '--force', action='store_true',
help="""Perform requested actions without prompting
for confirmation""")
Expand Down

0 comments on commit ed5d0d7

Please sign in to comment.