You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 and rich-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 to rich. 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. In cmd2 3.0 they will call a function like add_alert() which adds to a queue and cmd2 will handle printing alerts when the prompt is on screen. Async prompt updates will provide a similar method.
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 call self._complete_statement() directly.
No longer removing macros since people are using them. I added ability to develop custom macro tab completion.
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 main cmd2 code or at least not be needed to run our unit tests?
Now that
cmd2 2.5.0is out, I'd like to start thinking aboutcmd2 3.0.0. So here are a few features I'd like to see based on feedback we've received over the years.Full
richandrich-argparseintegration.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
richwas developing their table functionality so I wasn't aware of their library. In the years since,richhas 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-argparseand I'm finding the switch very easy.Make async alerts and prompt changes event driven.
self.terminal_lockto asynchronously print an alert. Incmd2 3.0they will call a function likeadd_alert()which adds to a queue andcmd2will handle printing alerts when the prompt is on screen. Async prompt updates will provide a similar method.Consider moving some built-in commands to
CommandSetsor mixin classes.Remove macros.
self._input_line_to_statement(). We could just callself._complete_statement()directly.Modernize build system to be based on pyproject.toml #1334
ext_testplugin 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 maincmd2code or at least not be needed to run our unit tests?