Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/wstool/cli_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from optparse import OptionParser
from wstool.common import samefile, MultiProjectException, select_elements

ONLY_OPTION_VALID_ATTRS = ['path', 'localname', 'version',
ONLY_OPTION_VALID_ATTRS = ['path', 'localname', 'version', 'cur_version',
'revision', 'cur_revision', 'uri', 'cur_uri', 'scmtype']


Expand Down Expand Up @@ -413,9 +413,9 @@ def get_info_table_raw_csv(config, properties, localnames):
lookup_required = False
for attr in properties:
if not attr in ONLY_OPTION_VALID_ATTRS:
parser.error("Invalid --only option '%s', valids are %s" %
(attr, ONLY_OPTION_VALID_ATTRS))
if attr in ['cur_revision', 'cur_uri', 'revision']:
OptionParser().error("Invalid --only option '%s', valids are %s" %
(attr, ONLY_OPTION_VALID_ATTRS))
if attr in ['cur_revision', 'cur_uri', 'revision', 'cur_version']:
lookup_required = True
elements = select_elements(config, localnames)
result=[]
Expand All @@ -436,6 +436,8 @@ def get_info_table_raw_csv(config, properties, localnames):
output.append(spec.get_uri() or '')
if 'version' == attr:
output.append(spec.get_version() or '')
if 'cur_version' == attr:
output.append(spec.get_curr_version() or '')
if 'revision' == attr:
output.append(spec.get_revision() or '')
if 'cur_uri' == attr:
Expand Down
4 changes: 4 additions & 0 deletions src/wstool/multiproject_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,10 @@ def cmd_info(self, target_path, argv, reverse=True, config=None):
only_options = options.only.split(",")
if only_options == '':
parser.error('No valid options given')
for attr in only_options:
if attr not in ONLY_OPTION_VALID_ATTRS:
parser.error("Invalid --only option '%s', valids are %s" %
(attr, ONLY_OPTION_VALID_ATTRS))
lines = get_info_table_raw_csv(config,
properties=only_options,
localnames=args)
Expand Down