From 5fd8e00010e068eb0632b6cb20860a18774181a5 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Thu, 23 Apr 2020 16:35:17 -0400 Subject: Documented CompletionError class --- cmd2/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmd2') diff --git a/cmd2/utils.py b/cmd2/utils.py index 3fd9e3ac..5a4fdbf7 100644 --- a/cmd2/utils.py +++ b/cmd2/utils.py @@ -74,12 +74,12 @@ def str_to_bool(val: str) -> bool: class CompletionError(Exception): """ - Raised during tab completion operations to report any sort of error you want printed by the ArgparseCompleter - This can also be used just to display a message, even if it's not an error. ArgparseCompleter raises - CompletionErrors to display tab completion hints and sets apply_style to False so hints aren't colored - like error text. + Raised during tab completion operations to report any sort of error you want printed. This can also be used + just to display a message, even if it's not an error. For instance, ArgparseCompleter raises CompletionErrors + to display tab completion hints and sets apply_style to False so hints aren't colored like error text. Example use cases + - Reading a database to retrieve a tab completion data set failed - A previous command line argument that determines the data set being completed is invalid - Tab completion hints -- cgit v1.2.1 From 502fdff29b755bec83808352db8777e6e1057757 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Thu, 23 Apr 2020 18:01:23 -0400 Subject: Completion doc updates --- cmd2/argparse_custom.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'cmd2') diff --git a/cmd2/argparse_custom.py b/cmd2/argparse_custom.py index 5c3d6223..f018f33f 100644 --- a/cmd2/argparse_custom.py +++ b/cmd2/argparse_custom.py @@ -188,18 +188,15 @@ and will not include the description value of the CompletionItems. **Patched argparse functions** -argparse._ActionsContainer.add_argument - adds arguments related to tab - completion and enables nargs range - parsing See _add_argument_wrapper for - more details on these argument - -argparse.ArgumentParser._get_nargs_pattern - adds support to for nargs ranges - See _get_nargs_pattern_wrapper for - more details - -argparse.ArgumentParser._match_argument - adds support to for nargs ranges See - _match_argument_wrapper for more - details +``argparse._ActionsContainer.add_argument`` - adds arguments related to tab +completion and enables nargs range parsing. See _add_argument_wrapper for +more details on these arguments. + +``argparse.ArgumentParser._get_nargs_pattern`` - adds support to for nargs +ranges. See _get_nargs_pattern_wrapper for more details. + +``argparse.ArgumentParser._match_argument`` - adds support to for nargs ranges. +See _match_argument_wrapper for more details. """ import argparse -- cgit v1.2.1