Skip to content

Commit 0c3458b

Browse files
committed
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.
1 parent 50a8b00 commit 0c3458b

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Features:
3434
properly entered, the change is committed. (John Rouillard)
3535
- add support for dictConfig style logging configuration. Ini/File
3636
style configs will still be supported. (John Rouillard)
37+
- add 'q' as alias for quit in roundup-admin interactive mode. (John
38+
Rouillard)
3739

3840
2025-07-13 2.5.0
3941

doc/admin_guide.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,6 +2067,9 @@ The basic usage is:
20672067
Commands may be abbreviated as long as the abbreviation
20682068
matches only one command, e.g. l == li == lis == list.
20692069

2070+
In interactive mode entering: ``q``, ``quit``, or ``exit`` alone on a
2071+
line will exit the program.
2072+
20702073
One thing to note, The ``-u user`` setting does not currently operate
20712074
like a user logging in via the web. The user running roundup-admin
20722075
must have read access to the tracker home directory. As a result the

roundup/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2415,7 +2415,8 @@ def interactive(self):
24152415
except ValueError:
24162416
continue # Ignore invalid quoted token
24172417
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
24192420
self.run_command(args)
24202421

24212422
# exit.. check for transactions

test/test_admin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def testBasicInteractive(self):
150150
expected = 'ready for input.\nType "help" for help.'
151151
self.assertEqual(expected, out[-1*len(expected):])
152152

153-
inputs = iter(["list user", "quit"])
153+
inputs = iter(["list user", "q"])
154154

155155
AdminTool.my_input = lambda _self, _prompt: next(inputs)
156156

@@ -1067,7 +1067,7 @@ def testPragma_reopen_tracker(self):
10671067

10681068
# must set verbose to see _reopen_tracker hidden setting.
10691069
# and to get "Reopening tracker" verbose log output
1070-
inputs = iter(["pragma verbose=true", "pragma list", "quit"])
1070+
inputs = iter(["pragma verbose=true", "pragma list", "exit"])
10711071
AdminTool.my_input = lambda _self, _prompt: next(inputs)
10721072

10731073
self.install_init()

0 commit comments

Comments
 (0)