Description
Now that cmd2 2.5.0
is out, I'd like to start thinking about cmd2 3.0.0
. So here are a few features I'd like to see based on feedback we've received over the years.
-
Full
rich
andrich-argparse
integration.-
I wrote the table and related formatting code in early 2020 to solve a problem that all existing table creators at the time had. None of them preserved text styles across multiple lines of a table cell. That was also right around the time
rich
was developing their table functionality so I wasn't aware of their library. In the years since,rich
has become the de facto library for formatting text in the terminal and it's widely used and well supported. So I think it's safe at this point to offload all of our text formatting torich
. This approach was also discussed in Regarding KISS and direction of the project #1251 . -
I have been testing our stuff with
rich-argparse
and I'm finding the switch very easy.
-
-
Make async alerts and prompt changes event driven.
- Currently developers must obtain
self.terminal_lock
to asynchronously print an alert. Incmd2 3.0
they will call a function likeadd_alert()
which adds to a queue andcmd2
will handle printing alerts when the prompt is on screen. Async prompt updates will provide a similar method.
- Currently developers must obtain
-
Consider moving some built-in commands to
CommandSets
or mixin classes.- What commands are best suited for this?
-
Remove macros.
- They were a neat idea at the time, but as 1350 points out, the lack of custom tab completion makes them difficult and confusing to use. Removing macros also eliminates the need for
self._input_line_to_statement()
. We could just callself._complete_statement()
directly.
- They were a neat idea at the time, but as 1350 points out, the lack of custom tab completion makes them difficult and confusing to use. Removing macros also eliminates the need for
-
Modernize build system to be based on pyproject.toml #1334
- Moving the
ext_test
plugin might help here as well. It currently has its own build system and is required to run our unit tests. Can it become a part of the maincmd2
code or at least not be needed to run our unit tests?
- Moving the