cli: fix `done` not returning

The previous `Done` commands would not return properly.
All `Done`/`Exit` commands have also gotten the common number 9
This commit is contained in:
Oystein Kristoffer Tveit 2023-05-10 17:45:07 +02:00
parent 78fa3076b9
commit 634397cdaf
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
3 changed files with 9 additions and 8 deletions

View File

@ -289,7 +289,7 @@ class WorblehatCli(NumberedCmd):
'f': do_abort, 'f': do_abort,
'doc': 'Abort changes', 'doc': 'Abort changes',
}, },
8: { 9: {
'f': do_exit, 'f': do_exit,
'doc': 'Exit', 'doc': 'Exit',
}, },

View File

@ -147,14 +147,15 @@ class NumberedCmd(Cmd):
except (ValueError, KeyError): except (ValueError, KeyError):
return return
self.funcs[i]['f'](self, arg) return self.funcs[i]['f'](self, arg)
def default(self, arg: str): def default(self, arg: str):
self._default(arg) return self._default(arg)
def _postcmd(self, stop: bool, line: str) -> bool: def _postcmd(self, stop: bool, _: str) -> bool:
if not stop:
print() print()
print('-----------------') print('-----------------')
print() print()

View File

@ -74,7 +74,7 @@ class BookcaseItemCli(NumberedCmd):
'f': do_update_data, 'f': do_update_data,
'doc': 'Pull updated data from online databases', 'doc': 'Pull updated data from online databases',
}, },
4: { 9: {
'f': do_done, 'f': do_done,
'doc': 'Done', 'doc': 'Done',
}, },