mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
add enhancements to CLI command-line completion and history
- Added support for pyreadline3 so that Window users can benefit. - Added the !search command to search the history for a matching string: ~~~ !search puppies [20] puppies at the food bowl -Ak_lms [54] house overrun by hungry puppies -C20 -s100 ~~~ - Added the !clear command to clear the in-memory and on-disk command history.
This commit is contained in:
@ -183,6 +183,15 @@ def main_loop(gen, opt, infile):
|
||||
completer.show_history()
|
||||
continue
|
||||
|
||||
elif subcommand.startswith('search'):
|
||||
search_str = command.replace('!search ','',1)
|
||||
completer.show_history(search_str)
|
||||
continue
|
||||
|
||||
elif subcommand.startswith('clear'):
|
||||
completer.clear_history()
|
||||
continue
|
||||
|
||||
elif re.match('^(\d+)',subcommand):
|
||||
command_no = re.match('^(\d+)',subcommand).groups()[0]
|
||||
command = completer.get_line(int(command_no))
|
||||
|
Reference in New Issue
Block a user