Right now the cli.py uses a custom CLI implementation, I believe for historic reasons. I think this can be refactored into being a RichCommand.
There are two main benefits of this.
First: simpler, more idiomatic, and more testable code. Testability is the most important sub-bullet here. Right now cli.py is not covered by tests. See #124. This lack of test coverage of cli.py has caused multiple regressions over the last couple months; see #142 and #152.
Second: it would be to allow for things like passing of configuration flags, which can allow users who are aliasing rich-click to set options such as color themes. For example:
alias foo="rich-click --rich-config '{"\style_option\": \"red\", \"width\": 100}' foo"
foo bar
In the above example, the user sets some command in their Python environment named foo to an alias that invokes rich-click with custom style options.
There may be other options and flags that are of interest here; that's just the first that comes to mind.
This is doable and theoretically simple since Click allows for arbitrary passing of args to a command:
Right now the
cli.py
uses a custom CLI implementation, I believe for historic reasons. I think this can be refactored into being aRichCommand
.There are two main benefits of this.
First: simpler, more idiomatic, and more testable code. Testability is the most important sub-bullet here. Right now
cli.py
is not covered by tests. See #124. This lack of test coverage ofcli.py
has caused multiple regressions over the last couple months; see #142 and #152.Second: it would be to allow for things like passing of configuration flags, which can allow users who are aliasing
rich-click
to set options such as color themes. For example:In the above example, the user sets some command in their Python environment named
foo
to an alias that invokesrich-click
with custom style options.There may be other options and flags that are of interest here; that's just the first that comes to mind.
This is doable and theoretically simple since Click allows for arbitrary passing of args to a command: