Skip to content

Commit 3cf43e1

Browse files
committed
Fixed bug where items tab completed in set were not current
1 parent 174cd13 commit 3cf43e1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

cmd2/cmd2.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,13 +1604,17 @@ def get_visible_commands(self) -> List[str]:
16041604
return commands
16051605

16061606
def get_alias_names(self) -> List[str]:
1607-
"""Return a list of alias names."""
1607+
"""Return list of current alias names"""
16081608
return list(self.aliases)
16091609

16101610
def get_macro_names(self) -> List[str]:
1611-
"""Return a list of macro names."""
1611+
"""Return list of current macro names"""
16121612
return list(self.macros)
16131613

1614+
def get_settable_names(self) -> List[str]:
1615+
"""Return list of current settable names"""
1616+
return list(self.settable)
1617+
16141618
def get_commands_aliases_and_macros_for_completion(self) -> List[str]:
16151619
"""Return a list of visible commands, aliases, and macros for tab completion"""
16161620
visible_commands = set(self.get_visible_commands())
@@ -2837,7 +2841,7 @@ def show(self, args: argparse.Namespace, parameter: str='') -> None:
28372841
set_parser.add_argument('-a', '--all', action='store_true', help='display read-only settings as well')
28382842
set_parser.add_argument('-l', '--long', action='store_true', help='describe function of parameter')
28392843
setattr(set_parser.add_argument('param', nargs='?', help='parameter to set or view'),
2840-
ACTION_ARG_CHOICES, settable)
2844+
ACTION_ARG_CHOICES, get_settable_names)
28412845
set_parser.add_argument('value', nargs='?', help='the new value for settable')
28422846

28432847
@with_argparser(set_parser)

0 commit comments

Comments
 (0)