Module with pre-defined reusable commandline arguments that can be used as click decorators.
aiida.cmdline.params.arguments.overridable.
OverridableArgument
Bases: object
object
Wrapper around click.argument that increases reusability
Once defined, the argument can be reused with a consistent name and sensible defaults while other details can be customized on a per-command basis
Example:
@click.command() @CODE('code') def print_code_pk(code): click.echo(code.pk) @click.command() @CODE('codes', nargs=-1) def print_code_pks(codes): click.echo([c.pk for c in codes])
Notice that the arguments, which are used to define the name of the argument and based on which the function argument name is determined, can be overriden
__call__
Override the stored kwargs with the passed kwargs and return the argument, using the stored args only if they are not provided. This allows the user to override the variable name, which is useful if for example they want to allow multiple value with nargs=-1 and want to pluralize the function argument for consistency
__dict__
__init__
Store the default args and kwargs
__module__
__weakref__
list of weak references to the object (if defined)