Skip to content

Commit 88850ab

Browse files
authored
make -v cycle between different verbosity settings (#27)
Make the ‘-v’ option cycle between nothing, ‘--verbose’, and ‘--verbose --verbose’. This was suggested before (#22 (review)) but wasn't possible at the time of #22 due to magit-popup.el limitations. Now that the dispatch menu uses transient.el instead of magit-popup.el (#18, #26), it can be implemented after all.
1 parent d64f983 commit 88850ab

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

python-pytest.el

+9-3
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ When non-nil only ‘test_foo()’ will match, and nothing else."
120120
(define-transient-command python-pytest-dispatch ()
121121
"Show popup for running pytest."
122122
:man-page "pytest"
123-
:incompatible '(("--verbose" "--verbose --verbose"))
124123
:value '("--color")
125124
["Switches"
126125
("-c" "color" "--color")
@@ -131,8 +130,7 @@ When non-nil only ‘test_foo()’ will match, and nothing else."
131130
("-q" "quiet" "--quiet")
132131
("-s" "do not capture output" "--capture=no")
133132
("-t" "do not cut tracebacks" "--full-trace")
134-
("-v" "verbose" ("-v" "--verbose"))
135-
("-w" "very verbose" ("-vv" "--verbose --verbose"))
133+
(python-pytest:-v)
136134
("-x" "exit after first failure" "--exitfirst")]
137135
["Options"
138136
("=k" "only names matching expression" "-k=")
@@ -426,6 +424,14 @@ When present ON-REPLACEMENT is substituted, else OFF-REPLACEMENT is appended."
426424
(format "%s %s" option it)))
427425
args))
428426

427+
(transient-define-argument python-pytest:-v ()
428+
:description "verbosity"
429+
:class 'transient-switches
430+
:key "-v"
431+
:argument-format "%s"
432+
:argument-regexp "\\(--verbose\\|--verbose --verbose\\)"
433+
:choices '("--verbose" "--verbose --verbose"))
434+
429435
(transient-define-argument python-pytest:--tb ()
430436
:description "traceback style"
431437
:class 'transient-option

0 commit comments

Comments
 (0)