-
Notifications
You must be signed in to change notification settings - Fork 128
Partial command parse #1325
-
Hi folks,
I have 3 commands in my cmd2 application: namely device, start, stop. Is it possible for me to invoke do_device() just by pressing 'd' alone because from all the possible cmd list it seems only 'device' matches so it should be able to invoke the same right? Is there a setting that can enable this???
Alias is a fine solution to this problem, but i am thinking if this auto command match works with cmd2.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 5 replies
-
I don't recall if it's covered in our tests or is still functional, but this plug-in exists.
https://github.com/python-cmd2/cmd2-abbrev
Beta Was this translation helpful? Give feedback.
All reactions
-
thanks for calling it out
Beta Was this translation helpful? Give feedback.
All reactions
-
Traceback (most recent call last):
File "laut.py", line 2149, in <module>
deviceShell = lautShell()
File "laut.py", line 60, in __init__
super().__init__(*args, **kwargs)
File "/nobackup/araradha/pyats/lib/python3.8/site-packages/cmd2_abbrev/abbrev.py", line 17, in __init__
self.add_settable(cmd2.Settable('abbrev', bool, 'Accept command abbreviations'))
TypeError: __init__() missing 1 required positional argument: 'settable_object'
Beta Was this translation helpful? Give feedback.
All reactions
-
Getting above error
Beta Was this translation helpful? Give feedback.
All reactions
-
i see that add_settable() has a different signature now. So is there any way the plugin could work??
Beta Was this translation helpful? Give feedback.
All reactions
-
@Sripadvallabh Feel free to submit a PR to fix the cmd2-abbrev extension for the updated settable
Beta Was this translation helpful? Give feedback.