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,
'doc': 'Abort changes',
},
8: {
9: {
'f': do_exit,
'doc': 'Exit',
},

View File

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

View File

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