|
68 | 68 | ''' % locals() |
69 | 69 |
|
70 | 70 |
|
71 | | -reportable_errors = [u'CRITICAL', u'ERROR', u'WARNING'] |
72 | | - |
73 | 71 |
|
74 | 72 | def print_version(): |
75 | 73 | click.echo('Running aboutcode-toolkit version ' + __version__) |
76 | 74 |
|
77 | 75 |
|
| 76 | +class AboutCommand(click.Command): |
| 77 | + def main(self, args=None, prog_name=None, complete_var=None, |
| 78 | + standalone_mode=True, **extra): |
| 79 | + """ |
| 80 | + Workaround click bug https://github.com/mitsuhiko/click/issues/365 |
| 81 | + """ |
| 82 | + return AboutCommand.main( |
| 83 | + self, args=args, prog_name=self.name, |
| 84 | + complete_var=complete_var, standalone_mode=standalone_mode, **extra) |
| 85 | + |
| 86 | + |
78 | 87 | # we define a main entry command with subcommands |
79 | 88 | @click.group(name='about') |
80 | 89 | @click.version_option(version=__version__, prog_name=prog_name, message=intro) |
@@ -109,7 +118,7 @@ def validate_filter(ctx, param, value): |
109 | 118 | return kvals |
110 | 119 |
|
111 | 120 |
|
112 | | -@cli.command(cls=click.Command, |
| 121 | +@cli.command(cls=AboutCommand, |
113 | 122 | short_help='Collect .ABOUT files and write an inventory as CSV or JSON.') |
114 | 123 |
|
115 | 124 | @click.argument('location', |
@@ -218,7 +227,7 @@ def inventory(location, output, mapping, mapping_file, |
218 | 227 | # gen subcommand |
219 | 228 | ###################################################################### |
220 | 229 |
|
221 | | -@cli.command(cls=click.Command, |
| 230 | +@cli.command(cls=AboutCommand, |
222 | 231 | short_help='Generate .ABOUT files from an inventory as CSV or JSON.') |
223 | 232 |
|
224 | 233 | @click.argument('location', |
@@ -329,7 +338,7 @@ def validate_variables(ctx, param, value): |
329 | 338 | return kvals |
330 | 339 |
|
331 | 340 |
|
332 | | -@cli.command(cls=click.Command, |
| 341 | +@cli.command(cls=AboutCommand, |
333 | 342 | short_help='Generate an attribution document from .ABOUT files.') |
334 | 343 |
|
335 | 344 | @click.argument('location', |
@@ -431,7 +440,7 @@ def attrib(location, output, template, variable, |
431 | 440 | # check subcommand |
432 | 441 | ###################################################################### |
433 | 442 |
|
434 | | -@cli.command(cls=click.Command, |
| 443 | +@cli.command(cls=AboutCommand, |
435 | 444 | short_help='Validate that the format of .ABOUT files is correct.') |
436 | 445 |
|
437 | 446 | @click.argument('location', |
|
0 commit comments