quickie.command

quickie.command(obj: Callable[[...], Sequence[str] | str]) Command
quickie.command(*, env: dict[str, str] | None = None, wd: str | None = None, **kwargs: Unpack[CommonTaskKwargs]) PartialReturnType[Command]

Create a command task from a function.

@command(name="hello", bind=True)
def run_program(task):
    return ["program", "arg1", "arg2"]

@command
def hello_world():
    """Docstring will be used as help text."""
    return ["program", "arg1", "arg2"]
Parameters:
  • obj – The function to create the command task from.

  • kwargs – Common keyword arguments for tasks. See CommonTaskKwargs for more information.

  • env – The environment variables for the command task.

  • wd – The working directory for the command task.

Returns:

The command task class, or, if obj is None, a partial function to be used as a decorator for a function.