summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into ac_parserTodd Leonhardt2018-08-241-0/+43
|\
| * Added a couple unit tests of the exit code featureTodd Leonhardt2018-08-231-4/+2
| |
| * Added way of returning a non-zero exit code to the shellTodd Leonhardt2018-08-231-0/+45
| |
* | ACHelpFormatter now inherits from argparse.RawTextHelpFormatter to make it ↵Kevin Van Brunt2018-08-241-7/+4
|/ | | | easier to format help/description text
* Copied and reduced the tab_autocompletion example to specifically exercise ↵Eric Lin2018-08-191-0/+240
| | | | | | updating the argparse object during init instead of durng the class construction.
* Updated argparse_completer to automatically set the matches_sorted flag for ↵Eric Lin2018-08-011-5/+7
| | | | tabular results. Updated the example to demonstrate pre-sorted tabular results.
* Fix Sphinx warning due to _static directoryTodd Leonhardt2018-07-301-2/+3
| | | | | Also: - Made alias_startup.py example robust as to what directory it is launched from
* Add example and documentation for #452kotfu2018-07-291-0/+114
|
* Address feedback in PRkotfu2018-07-211-2/+2
|
* Add hook examplekotfu2018-07-211-0/+115
|
* Rows with very high population density now have foreground text color set to redTodd Leonhardt2018-06-281-10/+28
|
* Made table more readable when colored module is installedTodd Leonhardt2018-06-271-1/+1
|
* Deleted unused constant for DEFAULT_GRIDTodd Leonhardt2018-06-271-19/+19
| | | | | | Also: - Improved some comments - Put the argparse args for selecting grid style in a mutually exclusive group
* table and object_table commands now accept argparse arguments for formatting ↵Todd Leonhardt2018-06-271-20/+28
| | | | the grid style
* Fixed table width for MumbaiTodd Leonhardt2018-06-271-2/+1
| | | | Changed to use Hindi name for Mumbai based on Google Translate instead of a Google search and the table width and underlying wide character width calculation appears to be working fine.
* Merge branch 'master' into table_displayTodd Leonhardt2018-06-261-0/+98
|\
| * Just added some comments at the top of the example to try to give some contextTodd Leonhardt2018-06-261-1/+18
| |
| * Example added demonstrating bash completion bridging argcomplete with ↵Eric Lin2018-06-261-0/+81
| | | | | | | | AutoCompleter
* | Added city names in their native tongue in parentheses to demonstrate ↵Todd Leonhardt2018-06-261-17/+12
| | | | | | | | | | | | | | unicode capability - Mandarin, Urdu, and Turkish all seem to be working fine - But something is up with Hindi - the table/colum width calculation is messed up for Mumbai
* | Updating the example with unicode characters as well as demonstrating the ↵Eric Lin2018-06-261-21/+86
| | | | | | | | same table entries formatted as both an iterable of iterable as well as an iterable of objects.
* | table_display.py example now uses tableformatter instead of tabulateTodd Leonhardt2018-06-261-17/+60
|/ | | | Changed the table_display.py example to use the tableformatter module which resuls in nicer looking tables.
* Deprecated CmdResult helper class and promoted CommandResultTodd Leonhardt2018-06-232-5/+8
| | | | | | | | | | | | | | These classes are subtly different, particularly in terms of their truthiness. CmdResult - attributes: out, err, war - truthy: if err is falsy CommandResult - attributes: stdout, stderr, data - truthy: if err is falsy AND data is not None So CmdResult was oriented to provide essentially info, error, and warning messages to the user (typically as stirngs), whereas CommandResult is geared towards providing info and error messages to the user as strings in addition to data to the user in a command-specific format which is arbitrary other than it should never be None if the command succeeds.
* Altered behavior further to lean towards giving the developer more power ↵Todd Leonhardt2018-06-161-12/+30
| | | | | | | | | | | | | over the end user Specifically: - PAGER environment variable is not used by default to set cmd2.Cmd.pager - This is done to ensure a consistent behavior of cmd2 applications across users by default Developers are free to set pager and pager_chop in the __init__() for their class derived from cmd2.Cmd differently to ensure whatever behavior they desire. Also: - Updated the paged_output.py example to demonstrate using ppaged() with both wrapped and chopped/truncated text
* Merge branch 'master' into ppaged_pager_envTodd Leonhardt2018-06-131-3/+2
|\
| * Added a check to verify the existence of a descriptive header. Added a ↵Eric Lin2018-06-131-3/+2
| | | | | | | | constant. Updated example to use the constant.
* | Added pager settable parameter to control the command used to display paged ↵Todd Leonhardt2018-06-111-6/+15
|/ | | | | | | | | | | output Also: - ppaged() now uses the pager settable parameter - By default the pager settable parameter uses the PAGER environment variable if present - If PAGER environment variable is not present, pager gets set to: - "less -SXRF" on POSIX OSes (macOS and Linux) - "more" on Windows
* Merge branch 'master' into autocompleterKevin Van Brunt2018-06-061-21/+2
|\
| * Simplify subcommnads.py exampleTodd Leonhardt2018-05-311-21/+2
| |
* | Adds possible support for tabular tab completion results.Eric Lin2018-06-061-1/+17
|/
* Fixed conditional.py scriptTodd Leonhardt2018-05-262-3/+4
| | | | | | Also: - Made self.locals_in_py = True for main.py and examples/python_scripting.py - This makes debugging easier in the embedded IPython shell provided by the opt-in ipy command
* Fix import stragglerskotfu2018-05-234-12/+17
|
* Standardize cmd2 imports in tests and exampleskotfu2018-05-2316-66/+58
|
* Fixes problem with not passing the parameter hint suppression down to ↵Eric Lin2018-05-221-0/+4
| | | | | | | | sub-commands Added hint suppression on a per-parameter basis Added helper function to force an parameter to fall back to bash completion instead of using Cmd2 completion. - Hinting is still enabled by default but can be suppressed in the helper function.
* Changed some unit tests to use pytest-mock instead of mocker/monkeypatch ↵Eric Lin2018-05-191-3/+12
| | | | | | | because they were failing for me. Added detection of ==SUPPRESS== in subcommand group names to avoid printing it in the help hint. Added some examples to tab_autocompletion to demonstrate how to tie in to cmd2 path_complete
* Some fixes to autocompleter to make it easier to do delimited and file ↵Eric Lin2018-05-181-1/+19
| | | | completion. Saving state - more to come.
* Extract submenu code to new projectkotfu2018-05-091-109/+0
|
* Another attempt at getting it working on travis.Eric Lin2018-05-041-3/+0
|
* Merge branch 'test_merge' into test_ply_mergeEric Lin2018-05-0217-56/+71
|\
| * Merge branch 'bash_completion' into bash_to_pyscriptEric Lin2018-05-0217-55/+67
| |\
| | * Addressed comments.Eric Lin2018-05-022-5/+2
| | |
| | * Added checks to detect if argcomplete is installed.Eric Lin2018-04-251-12/+17
| | |
| | * Removed the expensive imports from cmd2/__init__.pyEric Lin2018-04-2517-52/+63
| | | | | | | | | | | | | | | | | | | | | Added some shared definitions to cmd2/__init__.py -> maybe there's a better place for these? Figured out how to trick bash into showing argument hints. It's a bit weird. Updated all of the tests and examples to import cmd2 resources from their new location without the automatic imports in cmd2/__init__.py For #369
| * | Added support for customizing the pyscript bridge pystate object name.Eric Lin2018-05-021-0/+1
| | | | | | | | | | | | | | | | | | | | | Removed all legacy pystate objects. Changed default behavior to clear _last_result before each command Added utility for creating named tuples with default values Added tests to exercise new changes.
| * | Added more tests exercising the pyscript bridge.Eric Lin2018-04-302-0/+2
| | |
| * | Added support for translating function positional and keyword arguments into ↵Eric Lin2018-04-281-1/+1
| |/ | | | | | | | | | | argparse command positional and flag arguments. Added initial set of tests
* | Clean up documentation references to pyparsingkotfu2018-04-291-4/+1
| |
* | 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
|