summaryrefslogtreecommitdiff
path: root/cmd2/argparse_completer.py
diff options
context:
space:
mode:
authorEric Lin <anselor@gmail.com>2018-04-19 12:49:24 -0400
committerEric Lin <anselor@gmail.com>2018-04-19 12:49:24 -0400
commitdf09c85e8db95622820712f29228dac2dc049935 (patch)
tree3c6ccbd0b03a0ff510d112a97c512e87fc7999c4 /cmd2/argparse_completer.py
parentc2186332aeb6f59063bb410fca25ed400ce410cd (diff)
downloadcmd2-git-df09c85e8db95622820712f29228dac2dc049935.tar.gz
Identified and marked a few blocks of code that can't be reached during unit tests due to the lack of a real terminal. Some more comments.
Diffstat (limited to 'cmd2/argparse_completer.py')
-rwxr-xr-xcmd2/argparse_completer.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd2/argparse_completer.py b/cmd2/argparse_completer.py
index 03cc6483..35f9342b 100755
--- a/cmd2/argparse_completer.py
+++ b/cmd2/argparse_completer.py
@@ -52,6 +52,9 @@ How to supply completion choice lists or functions for sub-commands:
The subcommand group dictionary maps subcommand names to tuple(arg_choices, subcmd_args_lookup)
For more details of this more complex approach see tab_autocompletion.py in the examples
+
+Copyright 2018 Eric Lin <anselor@gmail.com>
+Released under MIT license, see LICENSE file
"""
import argparse
@@ -262,6 +265,12 @@ class AutoCompleter(object):
current_is_positional = False
consumed_arg_values = {} # dict(arg_name -> [values, ...])
+ # the following are nested functions that have full access to all variables in the parent
+ # function including variables declared and updated after this function. Variable values
+ # are current at the point the nested functions are invoked (as in, they do not receive a
+ # snapshot of these values, they directly access the current state of variables in the
+ # parent function)
+
def consume_flag_argument() -> None:
"""Consuming token as a flag argument"""
# we're consuming flag arguments