Runcommands

Latest version: v1.0a72

Safety actively analyzes 723144 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 13

1.0a56

- Default inverse short and long options are now only set for boolean
args. Previously, these would always be set up, which would cause
two short options to be consumed for every non-bool arg, which would
in turn keep the second short option from being used by another arg.
This regression was introduced in 1.0a52.
- Set the `base_name` attribute in `Command`'s constructor rather than
using a cached property. The cached property isn't needed, since the
base name is known in the constructor.

1.0a55

- Added ability to attach arbitrary data to commands via `data`
attribute on `Command` instances. Data items can be accessed via dot
(attribute) or bracket (item) notation.
- Added command callbacks. These are called after the last command runs,
starting with the callbacks for the last command. Callbacks allow for
cleanup, post-run messages, etc.

1.0a54

- Fixed/improved subcommand arg passdown logic.
- Added `fill_char` arg to `Printer.hr()` so a fill char other than `=`
can be used.

1.0a53

- Added `module` and `qualname` attributes to `Command` instances. These
correspond to the built in `__module__` and `__qualname__` attributes of
classes and can be used for introspection of a command. E.g., `module` can be
used to order commands by module in a command listing.
- Added support for command line completion for base commands used as console
scripts.

1.0a52

- Improve inverse options.

1.0a51

- Commonly-used utilities are now exported from the top level package. This is
intended to reduce tedium when creating lots of commands spread across many
modules. Includes `abort`, `confirm`, and `printer`.
- Made it somewhat easier to specify subcommands by allowing
`base_command.subcommand` to be used as a decorator. This reduces the number
of imports needed when creating subcommands. It also looks nicer than
`subcommand(base_command)` IMO.
- Changed the default color of `printer.hr()` from info (blue) to header
(magenta) since that's the color I usually want HRs to be.
- Made it a little easier to specify colors in `printer` by allowing colors in
the color map to be accessed as attributes (in addition to item access).

Page 4 of 13

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.