Skip to content

Commit d23f4c3

Browse files
committed
Do not rename --vartext option yet #332
Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent dc439a3 commit d23f4c3

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

src/attributecode/cmd.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,15 +344,15 @@ def gen(location, output,
344344

345345
def validate_variables(ctx, param, value):
346346
"""
347-
Return the variables if valid or raise a UsageError otherwise.
347+
Return the variable texts if valid or raise a UsageError otherwise.
348348
"""
349349
if not value:
350350
return
351351

352352
kvals, errors = parse_key_values(value)
353353
if errors:
354354
ive = '\n'.join(sorted(' ' + x for x in errors))
355-
msg = ('Invalid --variable option(s):\n'
355+
msg = ('Invalid --vartext option(s):\n'
356356
'{ive}'.format(**locals()))
357357
raise click.UsageError(msg)
358358
return kvals
@@ -394,11 +394,11 @@ def validate_template(ctx, param, value):
394394
help='Path to an optional custom attribution template to generate the '
395395
'attribution document. If not provided the default built-in template is used.')
396396

397-
@click.option('--variable',
397+
@click.option('--vartext',
398398
multiple=True,
399399
callback=validate_variables,
400400
metavar='<key>=<value>',
401-
help='Add variable(s) as key=value for use in a custom attribution template.')
401+
help='Add variable text as key=value for use in a custom attribution template.')
402402

403403
@click.option('--inventory',
404404
metavar='FILE',
@@ -429,7 +429,7 @@ def validate_template(ctx, param, value):
429429

430430
@click.help_option('-h', '--help')
431431

432-
def attrib(location, output, template, variable,
432+
def attrib(location, output, template, vartext,
433433
inventory, mapping, mapping_file,
434434
quiet, verbose):
435435
"""
@@ -455,7 +455,7 @@ def attrib(location, output, template, variable,
455455
abouts=abouts,
456456
output_location=output,
457457
template_loc=template,
458-
variables=variable,
458+
variables=vartext,
459459
mapping_file=mapping_file,
460460
inventory_location=inventory,
461461
)

tests/testdata/test_cmd/help/about_attrib_help.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ Usage: about attrib [OPTIONS] LOCATION OUTPUT
77
OUTPUT: Path where to write the attribution document.
88

99
Options:
10-
--template FILE Path to an optional custom attribution template to
11-
generate the attribution document. If not provided
12-
the default built-in template is used.
13-
--variable <key>=<value> Add variable(s) as key=value for use in a custom
14-
attribution template.
15-
--inventory FILE Path to an optional JSON or CSV inventory FILE
16-
listing the subset of .ABOUT files paths to consider
17-
when generating the attribution document.
18-
--mapping Use the default built-in "mapping.config" file with
19-
mapping between input keys and .ABOUT field
20-
names.Cannot be combined with the --mapping-file
21-
option.
22-
--mapping-file FILE Path to an optional custom mapping FILE with mapping
23-
between input keys and .ABOUT field names. Cannot be
24-
combined with the --mapping option.
25-
-q, --quiet Do not print error or warning messages.
26-
--verbose Show all error and warning messages.
27-
-h, --help Show this message and exit.
10+
--template FILE Path to an optional custom attribution template to
11+
generate the attribution document. If not provided
12+
the default built-in template is used.
13+
--vartext <key>=<value> Add variable text as key=value for use in a custom
14+
attribution template.
15+
--inventory FILE Path to an optional JSON or CSV inventory FILE
16+
listing the subset of .ABOUT files paths to consider
17+
when generating the attribution document.
18+
--mapping Use the default built-in "mapping.config" file with
19+
mapping between input keys and .ABOUT field
20+
names.Cannot be combined with the --mapping-file
21+
option.
22+
--mapping-file FILE Path to an optional custom mapping FILE with mapping
23+
between input keys and .ABOUT field names. Cannot be
24+
combined with the --mapping option.
25+
-q, --quiet Do not print error or warning messages.
26+
--verbose Show all error and warning messages.
27+
-h, --help Show this message and exit.

0 commit comments

Comments
 (0)