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:
parent
78fa3076b9
commit
634397cdaf
|
@ -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',
|
||||||
},
|
},
|
||||||
|
|
|
@ -147,17 +147,18 @@ 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:
|
||||||
print()
|
if not stop:
|
||||||
print('-----------------')
|
print()
|
||||||
print()
|
print('-----------------')
|
||||||
|
print()
|
||||||
return stop
|
return stop
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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',
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue