options.rst
This file
Path
docs/options.rst
608 lines · 16.5 KiB
Last changed by
Improved handling of dos/windows arguments greatly.Armin Ronacherbefore adoption133c417
History of this fileTake it
The walk stopped after 200 commits: lines older than a6f9401 point at it.
Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 1–6why, one step back1Options2=======34.. currentmodule:: click56Adding options to commands can be accomplished by the :func:`option`Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 7why, one step back7decorator. Since options can come in various different versions, thereAdded test for requiredArmin Ronacherbefore adoptiona6f9401
lines 8–13why, one step back8are a ton of parameters to configure their behavior.910Basic Value Options11-------------------1213The most basic option is a value option. These options accept oneMerge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 14why, one step back14argument which is a value. If no type is provided, the type of the defaultAdded test for requiredArmin Ronacherbefore adoptiona6f9401
line 15why, one step back15value is used. If no default value is provided the type is assumed to beMerge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
lines 16–17why, one step back16:data:`STRING`. By default, the name of the parameter is the first long17option defined; otherwise the first short one is used.Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 18–37why, one step back1819.. click:example::2021 @click.command()22 @click.option('--n', default=1)23 def dots(n):24 click.echo('.' * n)2526And on the command line:2728.. click:run::2930 invoke(dots, args=['--n=2'])3132In this case the option is of type :data:`INT` because the default value33is an integer.3435Multi Value Options36-------------------37Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 38why, one step back38Sometimes, you have options that take more than one argument. For options,Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 39–57why, one step back39only a fixed number of arguments is supported. This can be configured by40the ``nargs`` parameter. The values are then stored as a tuple.4142.. click:example::4344 @click.command()45 @click.option('--pos', nargs=2, type=float)46 def findme(pos):47 click.echo('%s / %s' % pos)4849And on the command line:5051.. click:run::5253 invoke(findme, args=['--pos', '2.0', '3.0'])5455Multiple Options56----------------57Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 58why, one step back58Similar to ``nargs`` there is also the case where you sometimes want toAdded test for requiredArmin Ronacherbefore adoptiona6f9401
lines 59–81why, one step back59support a parameter to be provided multiple times to and have all values60recorded and not just the last one. For instance ``git commit -m foo -m61bar`` would record two lines for the commit message. ``foo`` and ``bar``.62This can be accomplished with the ``multiple`` flag:6364Example:6566.. click:example::6768 @click.command()69 @click.option('--message', '-m', multiple=True)70 def commit(message):71 click.echo('\n'.join(message))7273And on the command line:7475.. click:run::7677 invoke(commit, args=['-m', 'foo', '-m', 'bar'])7879Counting80--------81Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
lines 82–84why, one step back82In some very rare circumstances, it's interesting to use the repetition83of options to count an integer up. This can be used for verbosity flags,84for instance:Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 85–88why, one step back8586.. click:example::8788 @click.command()Added count support and int rangesArmin Ronacherbefore adoption81930b5
line 89why, one step back89 @click.option('-v', '--verbose', count=True)Added test for requiredArmin Ronacherbefore adoptiona6f9401
line 90why, one step back90 def log(verbose):Added count support and int rangesArmin Ronacherbefore adoption81930b5
line 91why, one step back91 click.echo('Verbosity: %s' % verbose)Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 92–103why, one step back9293And on the command line:9495.. click:run::9697 invoke(log, args=['-vvv'])9899Boolean Flags100-------------101102Boolean flags are options that can be enabled or disabled. This can be103accomplished by defining two flags in one go separated by a slash (``/``)Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 104why, one step back104for enabling or disabling the option. (If a slash is in an option string,Some smaller doc updatesArmin Ronacherbefore adoption99f0da9
line 105why, one step back105click automatically knows that it's a boolean flag and will passMerge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 106why, one step back106``is_flag=True`` implicitly.) Click always wants you to provide an enableSome smaller doc updatesArmin Ronacherbefore adoption99f0da9
line 107why, one step back107and disable flag so that you can change the default later.Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 108–129why, one step back108109Example:110111.. click:example::112113 import os114115 @click.command()116 @click.option('--shout/--no-shout', default=False)117 def info(shout):118 rv = os.uname()[0]119 if shout:120 rv = rv.upper() + '!!!!111'121 click.echo(rv)122123And on the command line:124125.. click:run::126127 invoke(info, args=['--shout'])128 invoke(info, args=['--no-shout'])129Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 130why, one step back130If you really don't want an off-switch, you can just define one andAdded test for requiredArmin Ronacherbefore adoptiona6f9401
lines 131–150why, one step back131manually inform click that something is a flag:132133.. click:example::134135 import os136137 @click.command()138 @click.option('--shout', is_flag=True)139 def info(shout):140 rv = os.uname()[0]141 if shout:142 rv = rv.upper() + '!!!!111'143 click.echo(rv)144145And on the command line:146147.. click:run::148149 invoke(info, args=['--shout'])150Improved handling of dos/windows arguments greatly.Armin Ronacherbefore adoption133c417
lines 151–164why, one step back151Note that if a slash is contained in your option already (for instance if152you use windows style parameters where ``/`` is the prefix character you153can alternatively split the parameters through ``;`` instead):154155.. click:example::156157 @click.command()158 @click.option('/debug;/no-debug')159 def log(debug):160 click.echo('debug=%s' % debug)161162 if __name__ == '__main__':163 log()164Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 165–167why, one step back165Feature Switches166----------------167Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
lines 168–170why, one step back168In addition to boolean flags, there are also feature switches. These are169implemented by setting multiple options to the same parameter name and170defining a flag value. Note that by providing the ``flag_value`` parameter,Some smaller doc updatesArmin Ronacherbefore adoption99f0da9
lines 171–172why, one step back171click will implicitly set ``is_flag=True``.172Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 173why, one step back173To set a default flag, assign a value of `True` to the flag that should beSome smaller doc updatesArmin Ronacherbefore adoption99f0da9
line 174why, one step back174the default.Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 175–227why, one step back175176.. click:example::177178 import os179180 @click.command()181 @click.option('--upper', 'transformation', flag_value='upper',182 default=True)183 @click.option('--lower', 'transformation', flag_value='lower')184 def info(transformation):185 click.echo(getattr(os.uname()[0], transformation)())186187And on the command line:188189.. click:run::190191 invoke(info, args=['--upper'])192 invoke(info, args=['--lower'])193 invoke(info)194195.. _choice-opts:196197Choice Options198--------------199200Sometimes you want to have a parameter be a choice of a list of values.201In that case you can use :class:`Choice` type. It can be instantiated202with a list of valid values.203204Example:205206.. click:example::207208 @click.command()209 @click.option('--hash-type', type=click.Choice(['md5', 'sha1']))210 def digest(hash_type):211 click.echo(hash_type)212213What it looks like:214215.. click:run::216217 invoke(digest, args=['--hash-type=md5'])218 println()219 invoke(digest, args=['--hash-type=foo'])220 println()221 invoke(digest, args=['--help'])222223.. _option-prompting:224225Prompting226---------227Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
lines 228–230why, one step back228Sometimes, you want parameters that can be provided from the command line,229but if not, ask for user input. This can be implemented with click by230defining a prompt string.Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 231–247why, one step back231232Example:233234.. click:example::235236 @click.command()237 @click.option('--name', prompt=True)238 def hello(name):239 click.echo('Hello %s!' % name)240241And what it looks like:242243.. click:run::244245 invoke(hello, args=['--name=John'])246 invoke(hello, input=['John'])247Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 248why, one step back248If you are not happy with the default prompt string, you can ask forAdded test for requiredArmin Ronacherbefore adoptiona6f9401
lines 249–283why, one step back249a different one:250251.. click:example::252253 @click.command()254 @click.option('--name', prompt='Your name please')255 def hello(name):256 click.echo('Hello %s!' % name)257258What it looks like:259260.. click:run::261262 invoke(hello, input=['John'])263264Password Prompts265----------------266267Click also supports hidden prompts and asking for confirmation. This is268useful for password input:269270.. click:example::271272 @click.command()273 @click.option('--password', prompt=True, hide_input=True,274 confirmation_prompt=True)275 def encrypt(password):276 click.echo('Encrypting password to %s' % password.encode('rot13'))277278What it looks like:279280.. click:run::281282 invoke(encrypt, input=['secret', 'secret'])283Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 284why, one step back284Because this combination of parameters is quite common, this can also beAdded test for requiredArmin Ronacherbefore adoptiona6f9401
lines 285–297why, one step back285replaced with the :func:`password_option` decorator:286287.. click:example::288289 @click.command()290 @click.password_option()291 def encrypt(password):292 click.echo('Encrypting password to %s' % password.encode('rot13'))293294Callbacks and Eager Options295---------------------------296297Sometimes you want a parameter to completely change the execution flow.Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 298why, one step back298For instance, this is the case when you want to have a ``--version``Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 299–306why, one step back299parameter that prints out the version and then exits the application.300301In such cases you need two concepts: eager parameters and a callback. An302eager parameter is a parameter that is handled before others and a303callback is what executes after the parameter is handled. The eagerness304is necessary so that an earlier required parameter does not produce an305error message. For instance if ``--version`` was not eager and a306parameter ``--foo`` was required and defined before, you would need toAdded strong support for a defined parameter callback evaluation order.Armin Ronacherbefore adoption5381d65
lines 307–308why, one step back307specify it for ``--version`` to work. For more information see308:ref:`callback-evaluation-order`.Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 309–318why, one step back309310A callback is a function that is invoked with two parameters: the current311:class:`Context` and the value. The context provides some useful features312such as quitting the application and gives access to other already313processed parameters.314315Here an example for a ``--version`` flag:316317.. click:example::318Changed parameter callback signature.Armin Ronacherbefore adoptionbda39db
line 319why, one step back319 def print_version(ctx, param, value):Added resilient parsing to the docsArmin Ronacherbefore adoptionaeb297c
line 320why, one step back320 if not value or ctx.resilient_parsing:Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 321–331why, one step back321 return322 click.echo('Version 1.0')323 ctx.exit()324325 @click.command()326 @click.option('--version', is_flag=True, callback=print_version,327 expose_value=False, is_eager=True)328 def hello():329 click.echo('Hello World!')330331The `expose_value` parameter prevents the now pretty pointless ``version``Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 332why, one step back332parameter to be passed to the callback. If that was not specified, aAdded resilient parsing to the docsArmin Ronacherbefore adoptionaeb297c
lines 333–335why, one step back333boolean would be passed to the `hello` script. The `resilient_parsing`334flag is set on the context if click wants to parse the command line335without and destructive behavior that would change the execution flow. InMerge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 336why, one step back336this case, because we would exit the program, we instead do nothing.Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 337–344why, one step back337338What it looks like:339340.. click:run::341342 invoke(hello)343 invoke(hello, args=['--version'])344Added notes on callback changes to the docsArmin Ronacherbefore adoptiond27f3a6
lines 345–346why, one step back345.. admonition:: Callback Signature Changes346Merge branch 'master' of https://github.com/mitsuhiko/clickArmin Ronacherbefore adoption8bd9f7a
line 347why, one step back347 In click 2.0 the signature for callbacks changed. For moreAdded notes on callback changes to the docsArmin Ronacherbefore adoptiond27f3a6
lines 348–349why, one step back348 information about these changes see :ref:`upgrade-to-2.0`.349Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 350–352why, one step back350Yes Parameters351--------------352Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 353why, one step back353For dangerous operations, it's very useful to be able to ask a user forAdded test for requiredArmin Ronacherbefore adoptiona6f9401
lines 354–359why, one step back354confirmation. This can be done by adding a boolean ``--yes`` flag and355asking for confirmation if the user did not provide it and to fail in a356callback:357358.. click:example::359Changed parameter callback signature.Armin Ronacherbefore adoptionbda39db
line 360why, one step back360 def abort_if_false(ctx, param, value):Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 361–377why, one step back361 if not value:362 ctx.abort()363364 @click.command()365 @click.option('--yes', is_flag=True, callback=abort_if_false,366 expose_value=False,367 prompt='Are you sure you want to drop the db?')368 def dropdb():369 click.echo('Dropped all tables!')370371And what it looks like on the command line:372373.. click:run::374375 invoke(dropdb, input=['n'])376 invoke(dropdb, args=['--yes'])377Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 378why, one step back378Because this combination of parameters is quite common, this can also beAdded test for requiredArmin Ronacherbefore adoptiona6f9401
lines 379–383why, one step back379replaced with the :func:`confirmation_option` decorator:380381.. click:example::382383 @click.command()Fixed a bug in the docsArmin Ronacherbefore adoptiond2cddcf
line 384why, one step back384 @click.confirmation_option(help='Are you sure you want to drop the db?')Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 385–386why, one step back385 def dropdb():386 click.echo('Dropped all tables!')Added notes on callback changes to the docsArmin Ronacherbefore adoptiond27f3a6
lines 387–389why, one step back387388.. admonition:: Callback Signature Changes389Merge branch 'master' of https://github.com/mitsuhiko/clickArmin Ronacherbefore adoption8bd9f7a
line 390why, one step back390 In click 2.0 the signature for callbacks changed. For moreAdded notes on callback changes to the docsArmin Ronacherbefore adoptiond27f3a6
line 391why, one step back391 information about these changes see :ref:`upgrade-to-2.0`.Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 392–397why, one step back392393Values from Environment Variables394---------------------------------395396A very useful feature of click is the ability to accept parameters from397environment variables in addition to regular parameters. This allowsMerge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
lines 398–400why, one step back398tools to be automated much easier. For instance, you might want to pass399a configuration file with a ``--config`` parameter but also support exporting400a ``TOOL_CONFIG=hello.cfg`` key-value pair for a nicer developmentAdded test for requiredArmin Ronacherbefore adoptiona6f9401
lines 401–404why, one step back401experience.402403This is supported by click in two ways. One is to automatically build404environment variables which is supported for options only. To enable thisMerge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
lines 405–407why, one step back405feature, the ``auto_envvar_prefix`` parameter needs to be passed to the406script that is invoked. Each command and parameter is then added as an407uppercase underscore-separated variable. If you have a subcommandAdded test for requiredArmin Ronacherbefore adoptiona6f9401
line 408why, one step back408called ``foo`` taking an option called ``bar`` and the prefix isMerge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 409why, one step back409``MY_TOOL``, then the variable is ``MY_TOOL_FOO_BAR``.Added test for requiredArmin Ronacherbefore adoptiona6f9401
lines 410–452why, one step back410411Example usage:412413.. click:example::414415 @click.command()416 @click.option('--username')417 def greet(username):418 click.echo('Hello %s!' % username)419420 if __name__ == '__main__':421 greet(auto_envvar_prefix='GREETER')422423And from the command line:424425.. click:run::426427 invoke(greet, env={'GREETER_USERNAME': 'john'},428 auto_envvar_prefix='GREETER')429430The second option is to manually pull values in from specific environment431variables by defining the name of the environment variable on the option.432433Example usage:434435.. click:example::436437 @click.command()438 @click.option('--username', envvar='USERNAME')439 def greet(username):440 click.echo('Hello %s!' % username)441442 if __name__ == '__main__':443 greet()444445And from the command line:446447.. click:run::448449 invoke(greet, env={'USERNAME': 'john'})450451In that case it can also be a list of different environment variables452where the first one is picked.Documented alternative prefix charsArmin Ronacherbefore adoption521e9fc
line 453why, one step back453Added multi envvar docsArmin Ronacherbefore adoption61eb5e2
lines 454–456why, one step back454Multiple Values from Environment Values455---------------------------------------456Merge pull request #88 from julen/doc-fixesArmin Ronacherbefore adoptione45ef4c
line 457why, one step back457As options can accept multiple values, pulling in such values fromAdded multi envvar docsArmin Ronacherbefore adoption61eb5e2
lines 458–459why, one step back458environment variables (which are strings) is a bit more complex. The way459click solves this is by leaving it up to the type to customize thisMerge pull request #88 from julen/doc-fixesArmin Ronacherbefore adoptione45ef4c
lines 460–461why, one step back460behavior. For both ``multiple`` and ``nargs`` with values other than461``1``, click will invoke the :meth:`ParamType.split_envvar_value` method toAdded multi envvar docsArmin Ronacherbefore adoption61eb5e2
lines 462–464why, one step back462perform the splitting.463464The default implementation for all types is to split on whitespace. TheMerge pull request #88 from julen/doc-fixesArmin Ronacherbefore adoptione45ef4c
line 465why, one step back465exceptions to this rule are the :class:`File` and :class:`Path` typesAdded multi envvar docsArmin Ronacherbefore adoption61eb5e2
line 466why, one step back466which both split according to the operating system's path splitting rules.Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
lines 467–468why, one step back467On UNIX systems like Linux and OS X, the splitting happens for those on468every colon (``:``), and for Windows, on every semicolon (``;``).Added multi envvar docsArmin Ronacherbefore adoption61eb5e2
lines 469–490why, one step back469470Example usage:471472.. click:example::473474 @click.command()475 @click.option('paths', '--path', envvar='PATHS', multiple=True,476 type=click.Path())477 def perform(paths):478 for path in paths:479 click.echo(path)480481 if __name__ == '__main__':482 perform()483484And from the command line:485486.. click:run::487488 import os489 invoke(perform, env={'PATHS': './foo/bar%s./test' % os.path.pathsep})490Documented alternative prefix charsArmin Ronacherbefore adoption521e9fc
lines 491–515why, one step back491Other Prefix Characters492-----------------------493494Click can deal with alternative prefix characters, other than ``-`` for495options. This is for instance useful if you want to handle slashes as496parameters ``/`` or something similar. Note that this is strongly497discouraged in general because click wants developers to stay close to498POSIX semantics. However in certain situations this can be useful:499500.. click:example::501502 @click.command()503 @click.option('+w/-w')504 def chmod(w):505 click.echo('writable=%s' % w)506507 if __name__ == '__main__':508 chmod()509510And from the command line:511512.. click:run::513514 invoke(chmod, args=['+w'])515 invoke(chmod, args=['-w'])Improved handling of dos/windows arguments greatly.Armin Ronacherbefore adoption133c417
lines 516–528why, one step back516517Note that if you are using ``/`` as prefix character and you want to use a518boolean flag you need to separate it with ``;`` instead of ``/``:519520.. click:example::521522 @click.command()523 @click.option('/debug;/no-debug')524 def log(debug):525 click.echo('debug=%s' % debug)526527 if __name__ == '__main__':528 log()Added count support and int rangesArmin Ronacherbefore adoption81930b5
lines 529–538why, one step back529530.. _ranges:531532Range Options533-------------534535A special mention should go to the :class:`IntRange` type which works very536similar to the :data:`INT` type but restricts the value to fall into a537specific range (inclusive on both edges). It has two modes:538Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 539why, one step back539- the default mode (non-clamping mode) where a value that falls outsideAdded count support and int rangesArmin Ronacherbefore adoption81930b5
lines 540–565why, one step back540 of the range will cause an error.541- an optional clamping mode where a value that falls outside of the542 range will be clamped. This means that a range of ``0-5`` would543 return ``5`` for the value ``10`` or ``0`` for the value ``-1`` (for544 example).545546Example:547548.. click:example::549550 @click.command()551 @click.option('--count', type=click.IntRange(0, 20, clamp=True))552 @click.option('--digit', type=click.IntRange(0, 10))553 def repeat(count, digit):554 click.echo(str(digit) * count)555556 if __name__ == '__main__':557 repeat()558559And from the command line:560561.. click:run::562563 invoke(repeat, args=['--count=1000', '--digit=5'])564 invoke(repeat, args=['--count=1000', '--digit=12'])565Merge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 566why, one step back566If you pass ``None`` for any of the edges, it means that the range is openAdded count support and int rangesArmin Ronacherbefore adoption81930b5
line 567why, one step back567at that side.Added validation to docsArmin Ronacherbefore adoptiondf8f00b
lines 568–577why, one step back568569Callbacks for Validation570------------------------571572.. versionchanged:: 2.0573574If you want to apply custom validation logic you can do this in the575parameter callbacks. These callbacks can both modify values as well as576raise errors if the validation does not work.577Merge branch 'master' of https://github.com/mitsuhiko/clickArmin Ronacherbefore adoption8bd9f7a
line 578why, one step back578In click 1.0 you can only raise the :exc:`UsageError` but starting withMerge pull request #109 from iKevinY/doc-fixesArmin Ronacherbefore adoptiond428e69
line 579why, one step back579click 2.0 you can also raise the :exc:`BadParameter` error which has theAdded validation to docsArmin Ronacherbefore adoptiondf8f00b
lines 580–586why, one step back580added advantage that it will automatically format the error message to581also contain the parameter name.582583Example:584585.. click:example::586Changed parameter callback signature.Armin Ronacherbefore adoptionbda39db
line 587why, one step back587 def validate_rolls(ctx, param, value):Added validation to docsArmin Ronacherbefore adoptiondf8f00b
lines 588–608why, one step back588 try:589 rolls, dice = map(int, value.split('d', 2))590 return (dice, rolls)591 except ValueError:592 raise click.BadParameter('rolls need to be in format NdM')593594 @click.command()595 @click.option('--rolls', callback=validate_rolls, default='1d6')596 def roll(rolls):597 click.echo('Rolling a %d-sided dice %d time(s)' % rolls)598599 if __name__ == '__main__':600 roll()601602And what it looks like:603604.. click:run::605606 invoke(roll, args=['--rolls=42'])607 println()608 invoke(roll, args=['--rolls=2d12'])