summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Added clearer exception handling to BorderedTable and SimpleTableKevin Van Brunt2021-11-241-1/+23
|
* Added unit tests for right-aligned numbers in completion hint tablesKevin Van Brunt2021-11-181-22/+49
|
* ArgparseCompleter now sorts CompletionItems created with numerical values as ↵Kevin Van Brunt2021-11-182-44/+53
| | | | | | | | | numbers. Completion hint tables now right-align the left column if the hints have a numerical type. Fixed issue introduced in 2.3.0 with AlternatingTable, BorderedTable, and SimpleTable that caused header alignment settings to be overridden by data alignment settings.
* Added ability to use CompletionItems as argparse choicesKevin Van Brunt2021-11-182-1/+56
|
* Added ability to set border background color on BorderTables and ↵Kevin Van Brunt2021-11-101-27/+28
| | | | AlternatingTables
* Added type checks to ansi.style()Kevin Van Brunt2021-10-271-1/+11
|
* Updated table example.Kevin Van Brunt2021-10-261-15/+15
| | | | | | Renamed Column settings: override_header_style -> style_header_text override_data_style -> style_data_text
* Added ability to colorize all aspects of SimpleTablesKevin Van Brunt2021-10-251-15/+38
|
* Added unit test for Cmd.select() return valuesKevin Van Brunt2021-10-251-0/+38
|
* Added ability to colorize all aspects of BorderedTables and AlternatingTables.Kevin Van Brunt2021-10-192-41/+69
| | | | Refactored utils.align_text() to print less fill_char style characters.
* Added support for 8-bit/256-colors with the cmd2.EightBitFg and ↵Kevin Van Brunt2021-10-187-160/+270
| | | | | | | | | | | | | | cmd2.EightBitBg classes. Added support for 24-bit/RGB colors with the cmd2.RgbFg and cmd2.RgbBg classes. Removed dependency on colorama. Deprecated cmd2.fg. Use cmd2.Fg instead. Deprecated cmd2.bg. Use cmd2.Bg instead. Changed type of ansi.allow_style from a string to an ansi.AllowStyle Enum class. Fixed bug where using choices on a Settable didn't verify that a valid choice had been entered.
* Added settings to Column class which prevent a table from overriding ↵Kevin Van Brunt2021-10-131-6/+33
| | | | | | | | | | existing styles in header and/or data text. These were added to support nesting an AlternatingTable within an AlternatingTable, but other custom table classes can also use these settings. AlternatingTable no longer applies background color to outer borders. This was done to improve appearance since the background color extended beyond the borders of the table.
* Updated async_alert() to account for self.prompt not matching Readline's ↵Kevin Van Brunt2021-09-141-21/+16
| | | | current prompt.
* Argparse tab completer will complete remaining flag names if there are no ↵Kevin Van Brunt2021-09-071-0/+14
| | | | more positionals to complete.
* Added ap_completer_type arg to Cmd2ArgumentParser.__init__().Kevin Van Brunt2021-09-011-28/+149
| | | | Added unit tests for custom ArgparseCompleter
* Refactored custom ArgparseCompleter functionality so they will now be set ↵Kevin Van Brunt2021-09-011-2/+2
| | | | | | using methods on ArgumentParser objects. This fixes issue where subcommands did not use the correct custom ArgparseCompleter type.
* Added self.last_result unit tests for the history command.Kevin Van Brunt2021-08-251-9/+54
|
* Added self.last_result unit tests for run_script, _relative_run_script, and ↵Kevin Van Brunt2021-08-251-1/+33
| | | | set commands.
* Fixed extra space appended to each alias by "alias list" command.Kevin Van Brunt2021-08-252-2/+61
| | | | Added self.last_result unit tests for alias, edit, eof, help, macro, quit, shortcuts, and run_pyscript commands.
* Merge branch 'master' into topic_widthKevin Van Brunt2021-08-232-6/+57
|\
| * Removed DEFAULT_ARGUMENT_PARSER and DEFAULT_COMMAND_COMPLETER from __init.py__Kevin Van Brunt2021-08-231-6/+4
| |
| * Applied black formatEric Lin2021-08-231-1/+2
| |
| * * New function `set_default_command_completer_type()` allows developer to ↵Eric Lin2021-08-231-0/+52
| | | | | | | | | | | | | | | | | | extend and modify the behavior of `ArgparseCompleter`. * New function `register_argparse_argument_parameter()` allows developers to specify custom parameters to be passed to the argparse parser's `add_argument()` method. These parameters will become accessible in the resulting argparse Action object when modifying `ArgparseCompleter` behavior.
* | set command output now uses SimpleTable.Kevin Van Brunt2021-08-195-61/+88
|/ | | | | | | Tabled tab completion now includes divider row. Tab completion results for aliases, macros, and Settables wrap long fields. SimpleTable now accepts blank for the divider character. It is identical to passing None. Removed --verbose flag from set command so the descriptions always show.
* Fixing tests on Python 3.10Kevin Van Brunt2021-06-175-35/+33
|
* Removed obsolete unit testKevin Van Brunt2021-06-141-27/+2
|
* Added unit tests for History and StatementKevin Van Brunt2021-06-142-0/+118
|
* Merge branch 'master' into make-run_editor-publicTodd Leonhardt2021-05-241-1/+1
|\
| * do_eof() now just calls the quit functionKevin Van Brunt2021-05-171-1/+1
| |
* | Make _run_editor() publicSimon J. Rowe2021-05-141-3/+3
|/
* Removed cmd2.Cmd.quit_on_sigint.Kevin Van Brunt2021-04-301-25/+2
|
* Stopping a shell command with Ctrl-C now raises a KeyboardInterrupt to ↵Kevin Van Brunt2021-04-301-0/+17
| | | | | | support stopping a text script which ran the shell command. On POSIX systems, shell commands and processes being piped to are now run in the user's preferred shell instead of /bin/sh.
* Changed default behavior of runcmds_plus_hooks() to not stop when Ctrl-C is ↵Kevin Van Brunt2021-04-301-7/+7
| | | | pressed and instead run the next command in its list.
* Renamed silent_startup_script to silence_startup_script for clarityKevin Van Brunt2021-04-281-4/+4
|
* Style changes from running black on Python 3.9Kevin Van Brunt2021-04-273-3/+3
|
* Made the amount of space between columns in a SimpleTable configurablecolumn_spacingKevin Van Brunt2021-04-211-0/+17
|
* Increased unit test coverage for pexcept()Kevin Van Brunt2021-04-131-0/+28
|
* Updated main code to use f-stringsKevin Van Brunt2021-04-131-3/+3
|
* And that's the last of it. Passes mypy.Eric Lin2021-04-061-5/+5
|
* Replaced some pexcept() calls with perror().Kevin Van Brunt2021-04-022-22/+15
| | | | | | Converted some strings to f-strings. Fixed some grammar in error messages and docs. Increased code coverage.
* Renamed use_ipython keyword parameter of cmd2.Cmd.__init__() to include_ipy.Kevin Van Brunt2021-03-305-43/+58
| | | | | | | | | | Added include_py keyword parameter to cmd2.Cmd.__init__(). If False, then the py command will not be available. Removed ability to run Python commands from the command line with py. Made banners and exit messages of Python and IPython consistent. Changed utils.is_text_file() to raise OSError if file cannot be read.
* No longer using -1 as an exit codeexit_codeKevin Van Brunt2021-03-231-1/+1
|
* onecmd_plus_hooks() now sets self.exit_code when a SystemExit handledKevin Van Brunt2021-03-232-2/+6
|
* Resolves comments from PREric Lin2021-03-183-3/+9
|
* Added testsEric Lin2021-03-181-1/+2
|
* Each CommandSet's settables are defined separately. cmd2.Cmd searches all ↵Eric Lin2021-03-181-4/+3
| | | | | | | | registered CommandSets for settables. Settables can now set any attribute on any object passed to it. The name the user sees may be set to a different value than what the actual attribute is. Cmd2 will now aggregate all settables on the cmd2.Cmd instance with each installed CommandSet.
* Fixed issue where argparse choices could not be CompletionItemsKevin Van Brunt2021-03-021-0/+19
|
* Merge branch 'master' into formatted_completionsKevin Van Brunt2021-03-021-107/+74
|\
| * Merge branch 'master' into history_fixKevin Van Brunt2021-03-022-3/+36
| |\
| * \ Merge branch 'master' into history_fixhistory_fixTodd Leonhardt2021-03-021-0/+8
| |\ \