Mercurial > p > roundup > code
comparison roundup/admin.py @ 8435:1a93dc58f975
feat: add 'q' as alias to quit to exit interactive roundup-admin
Also require no arguments to 'q', 'quit' or 'exit' before exiting.
Now typing 'quit a' will get an unknown command error.
Add to admin-guide how to get out of interactive mode.
Also test 'q' and 'exit' commands.
No upgrading docs added. Not that big a feature. Just noted in
CHANGES. Reporting error if argument provided is unlikely to be an
issue IMO, so no upgrading.txt entry.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 26 Aug 2025 23:37:42 -0400 |
| parents | e5d07fac0249 |
| children | 3bdae15252c6 |
comparison
equal
deleted
inserted
replaced
| 8434:66284037142e | 8435:1a93dc58f975 |
|---|---|
| 2413 try: | 2413 try: |
| 2414 args = token_r.token_split(command) | 2414 args = token_r.token_split(command) |
| 2415 except ValueError: | 2415 except ValueError: |
| 2416 continue # Ignore invalid quoted token | 2416 continue # Ignore invalid quoted token |
| 2417 if not args: continue # noqa: E701 | 2417 if not args: continue # noqa: E701 |
| 2418 if args[0] in ('quit', 'exit'): break # noqa: E701 | 2418 if args[0] in ('q', 'quit', 'exit') and len(args) == 1: |
| 2419 break # noqa: E701 | |
| 2419 self.run_command(args) | 2420 self.run_command(args) |
| 2420 | 2421 |
| 2421 # exit.. check for transactions | 2422 # exit.. check for transactions |
| 2422 if self.db and self.db_uncommitted: | 2423 if self.db and self.db_uncommitted: |
| 2423 commit = self.my_input(_('There are unsaved changes. Commit them (y/N)? ')) | 2424 commit = self.my_input(_('There are unsaved changes. Commit them (y/N)? ')) |
