summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* multilineCommands -> multiline_commandskotfu2018-04-294-4/+4
|
* Added support for using cmd2 application class methods as an argument ↵Eric Lin2018-04-231-1/+5
| | | | completion provider. The default completion implementation in Cmd2 automatically passes self to AutoCompleter to be passed to the class method.
* Addressed PR comments. Simplified some of the implementation per PR comments.Eric Lin2018-04-231-111/+85
|
* Added some more comments for clarification.Eric Lin2018-04-211-1/+1
|
* Added some documentation related to the latest changes.Eric Lin2018-04-211-1/+9
|
* Switched the default behavior in cmd2 for argparse commands to use the ↵Eric Lin2018-04-211-10/+1
| | | | AutoCompleter by default.
* Changed cmd2 to use autocompleter by default for all argparse commands. Not ↵Eric Lin2018-04-202-13/+100
| | | | all tests are passing yet.
* Started adding type hintsTodd Leonhardt2018-04-191-2/+1
|
* Identified and marked a few blocks of code that can't be reached during unit ↵Eric Lin2018-04-191-1/+5
| | | | tests due to the lack of a real terminal. Some more comments.
* Addresses comments on #362Eric Lin2018-04-191-12/+12
|
* Merge remote-tracking branch 'origin/master' into autocompleterEric Lin2018-04-181-2/+1
|\ | | | | | | | | Updated AutoCompleter (#349) to match new directory structure from packaging effort.
* | Some minor tweaks to AutoCompleter handling a collection of index-based ↵Eric Lin2018-04-171-1/+89
| | | | | | | | | | | | | | | | | | function arguments. Added example for fully custom completion functions mixed with argparse/AutoCompleter handling - Also demonstrates the ability to pass in a list, tuple, or dict of parameters to append to the custom completion function. Added new test cases exercising the custom completion function calls. Added AutoCompleter and rl_utils to the coverage report.
* | Added unit tests for AutoCompleter.Eric Lin2018-04-161-11/+8
| |
* | Added more advanced/complex autocompleter examples.Eric Lin2018-04-161-20/+174
| | | | | | | | Added more type hinting to AutoCompleter.
* | Matched changes in the python3 branch.Eric Lin2018-04-151-1/+1
| |
* | Merge remote-tracking branch 'origin/python3' into autocompleterEric Lin2018-04-1516-16/+16
|\ \ | |/
| * Started removing dependency on sixTodd Leonhardt2018-04-1516-16/+16
| | | | | | | | | | | | | | Removed all dependency on six other than for six.moves.input Also: - Started removing code branches which were for Python 2 support
* | * AutoCompleterEric Lin2018-04-151-8/+19
| | | | | | | | | | | | | | | | | | - Fixed a few bugs in AutoCompleter dealing with nargs='+' or nargs='*' - Adjusted some help output dealing with narg ranges - Fixed spacing problem with printing argument help * examples/tab_autocompletion.py - Removed debug code. - Minor changes.
* | Merge remote-tracking branch 'origin/master' into autocompleterEric Lin2018-04-152-28/+3
|\ \ | |/
| * Merged master into delete_optparse branchTodd Leonhardt2018-04-151-2/+2
| |\ | | | | | | | | | | | | Also: - Bumped version to 0.9.0
| | * Updated comments and examplesKevin Van Brunt2018-04-151-2/+2
| | |
| * | Merge branch 'master' into delete_optparseTodd Leonhardt2018-04-111-0/+145
| |\ \ | | |/ | | | | | | | | | # Conflicts: # cmd2.py
| * | Deleted optparse code which had been previously deprecated in 0.8.0 releaseTodd Leonhardt2018-04-091-26/+1
| | | | | | | | | | | | | | | Also: - Bumped version to 0.8.4
* | | Started working on an example for autocompleter usage.Eric Lin2018-04-141-0/+175
| |/ |/|
* | Added a with_category decorator that can be used to tag a command category.Eric Lin2018-04-111-6/+6
| | | | | | | | | | | | | | | | | | Changed the detection of with_argparse decorated commands to be less hacky/brittle. Now it tags the function with help_summary. Fixed issue with handling commands that provide a custom help_ function. We can now redirect the output to a string to be formatted with the other commands. Added some documentation explaining the new help categories. Updated unit tests.
* | Fixed issue where categorization is skipped when there's a help_<command> ↵Eric Lin2018-04-111-1/+8
| | | | | | | | | | | | | | | | function provided. In verbose help, added check for argparse usage block (starting with 'usage: '), to skip that block and move to the next comment block Added unit tests for new categorization code Updated example to demonstrate skipping of argparse usage statement
* | Added verbose help output with help -v or help --verboseEric Lin2018-04-101-1/+8
| | | | | | | | | | Reads the __doc__ for a command function and provides the first block of text for each command. Updated help_categories.py to demonstrate a multi-line comment block for a command.
* | Added a convenience function for tagging command categories.Eric Lin2018-04-091-19/+19
| |
* | Added ability to group commands by category when printing the help menu.Eric Lin2018-04-091-0/+131
|/ | | | Added example of multiple commands grouped by categories
* Simplified how to add tab completion to a subcommandKevin Van Brunt2018-03-281-6/+11
|
* Addressed code review commentsKevin Van Brunt2018-03-272-5/+4
|
* Removed unused importsKevin Van Brunt2018-03-251-2/+0
|
* Made subcommand specific completion work with Python 2 in the examplesKevin Van Brunt2018-03-242-29/+31
|
* Merge branch 'master' into new_quoted_completionKevin Van Brunt2018-03-231-2/+3
|\
| * Fixed check for whether a subcommand was enteredKevin Van Brunt2018-03-231-2/+3
| |
* | Renamed exclude_from_help to hidden_commandsKevin Van Brunt2018-03-221-4/+4
|/ | | | | Renamed excludeFromHistory to exclude_from_history No longer tab completing hidden commands
* Added an extra check to ppaged() to make sure cmd2 app is running in a real ↵Todd Leonhardt2018-03-201-0/+4
| | | | terminal before attempting to use a pager
* Added a default signal handler for SIGINT (Ctrl-C)Todd Leonhardt2018-03-191-3/+3
| | | | | | | | | | Added a default signal handler for SIGINT that does the following: - Terminates a pipe process if one exists - Raises a KeyboardInterrupt for other parts othe code to catch Also: - Changed the default value for quit_on_sigint to False - Modified the way the subcommand functions are called in subcommand.py (unrelated to rest of commit)
* Merge branch 'master' into startup_scriptTodd Leonhardt2018-03-161-4/+0
|\
| * Updated one example so it can be used properly with default_to_shellTodd Leonhardt2018-03-161-4/+0
| |
* | Added ability to specify a startup_script in cmd2.Cmd.__init__()Todd Leonhardt2018-03-162-0/+26
|/
* Fix unit tests and exampleTodd Leonhardt2018-03-161-2/+5
| | | | | | functools.partialmethod() was added in Python 3.4, so it can't be used in Python 2.7. - Modified the code to skip trying to use it for Python 2.7 - Skip the two unit tests which test its usage on Python 2.7
* Added unit tests and examples for tab completion of subcommandsKevin Van Brunt2018-03-161-7/+27
|
* No longer need to manually specify subcommand names for tab completionKevin Van Brunt2018-03-141-4/+1
|
* Added table_display.pyTodd Leonhardt2018-03-141-0/+64
| | | | | | | | Added example showing how to display tabular data in a cmd2 application. Also: - Updated CHANGELOG with data on all PRs since last release - Bumped version to 0.8.2 in preparation for next release
* Use self.poutput() instead of print() in arg_print.py exampleTodd Leonhardt2018-03-071-4/+4
|
* Added ppaged() method for printing output via a pagerTodd Leonhardt2018-03-071-0/+29
| | | | | | Also: - Added paged_output.py example - Modified cmd2 so it keeps track of when output is being redirected so it doesn't attempt to usage a pager in this case
* Removed support for case-insensitive command parsingTodd Leonhardt2018-03-021-25/+0
|
* Removed abbrev attributeKevin Van Brunt2018-03-023-3/+0
|
* Fixed some parsing bugs and added more unit testsKevin Van Brunt2018-03-021-1/+7
|