Skip to content

Commit 5be6b4b

Browse files
committed
Add short form option '-P' for '--no-pager'
Fixes #606 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
1 parent 646497f commit 5be6b4b

File tree

9 files changed

+18
-13
lines changed

9 files changed

+18
-13
lines changed

NEWS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ Modules 5.7.0 (not yet released)
5656
level. (fix issue #592)
5757
* Add :option:`-p` option as an abbreviated form for :option:`--paginate`.
5858
(fix issue #593)
59+
* Add :option:`-P` option as an abbreviated form for :option:`--no-pager`.
60+
(fix issue #606)
5961

6062

6163
.. _5.6 release notes:

doc/source/changes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ The following command line switches appeared on Modules 5.
845845
+------------+-----------------------------------------------------------------+
846846
| 5.6 | :option:`--dumpname` |
847847
+------------+-----------------------------------------------------------------+
848-
| 5.7 | :option:`-p` |
848+
| 5.7 | :option:`-p`, :option:`-P` |
849849
+------------+-----------------------------------------------------------------+
850850

851851
:option:`--output`

doc/source/module.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,14 +467,17 @@ switches are accepted:
467467
.. versionchanged:: 5.6
468468
Support for :subcmd:`spider` sub-command added
469469

470-
.. option:: --no-pager
470+
.. option:: --no-pager, -P
471471

472472
Do not pipe message output into a pager.
473473

474474
.. only:: html or latex
475475

476476
.. versionadded:: 4.1
477477

478+
.. versionchanged:: 5.7
479+
Short form option :option:`-P` added
480+
478481
.. option:: --no-redirect
479482

480483
Do not send message output to stdout. Keep it on stderr.

init/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ endif
120120
# define variables for shell completion
121121
comp_cmds := add add-any apropos aliases avail append-path cachebuild cacheclear clear config del describe disable display edit help initadd initclear initlist initprepend initrm is-loaded is-saved is-used is-avail info-loaded keyword lint list load load-any mod-to-sh path paths purge prepend-path refresh reload reset restore rm remove remove-path save savelist saveshow saverm search show sh-to-mod source spider stash stashclear stashlist stashpop stashrm stashshow state swap switch test try-add try-load unload unuse update use whatis
122122
comp_long_opts := --debug --dumpname --help --silent --trace --verbose --version --paginate --no-pager --color --color= --width --width= --ignore-cache --ignore-user-rc
123-
comp_opts := -D -h -s -T -v -V -p -w $(comp_long_opts)
123+
comp_opts := -D -h -s -T -v -V -p -P -w $(comp_long_opts)
124124
comp_load_opts := --auto --no-auto --force -f --icase -i --tag --tag=
125125
comp_unload_opts := --auto --no-auto --force -f --icase -i
126126
comp_list_opts := -a -j -l -o -t --all --json --long --output --output= --terse

init/fish_completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ complete -c module -s C -l contains --description 'Search modules whose name con
171171
complete -c module -l indepth --description 'Perform recursive avail search'
172172
complete -c module -l no-indepth --description 'Perform non-recursive avail search'
173173
complete -c module -s p -l paginate --description 'Pipe mesg output into a pager if stream attached to terminal'
174-
complete -c module -l no-pager --description 'Do not pipe message output into a pager'
174+
complete -c module -s P -l no-pager --description 'Do not pipe message output into a pager'
175175
complete -c module -l auto --description 'Enable automated module handling mode'
176176
complete -c module -l no-auto --description 'Disable automated module handling mode'
177177
complete -c module -s f -l force --description 'By-pass dependency consistency or confirmation dialog'

init/zsh-functions/_module.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ _module() {
130130
'--dumpname[Module implementation name]' \
131131
'(-w --width=)'{-w,--width=}'[Set output width]' \
132132
'(-p --paginate)'{-p,--paginate}'[Pipe mesg output into a pager if stream attached to terminal]' \
133-
'--no-pager[Do not pipe message output into a pager]' \
133+
'(-P --no-pager)'{-P,--no-pager}'[Do not pipe message output into a pager]' \
134134
'(--color --color=)'{--color,--color=}'[Colorize the output]' \
135135
'--ignore-cache[Ignore module cache]' \
136136
'--ignore-user-rc[Skip evaluation of user-specific module rc file]' \

tcl/main.tcl.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ if {[catch {
705705
-p - --paginate {
706706
set asked_paginate 1
707707
}
708-
--no-pager {
708+
-P - --no-pager {
709709
set asked_paginate 0
710710
}
711711
--redirect {

tcl/report.tcl.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2170,7 +2170,7 @@ Options:
21702170
-s | --silent Turn off error, warning and informational messages
21712171
--timer Report execution times
21722172
-p | --paginate Pipe mesg output into a pager if stream attached to terminal
2173-
--no-pager Do not pipe message output into a pager
2173+
-P | --no-pager Do not pipe message output into a pager
21742174
--redirect Send output to stdout (only for sh, bash, ksh, zsh and fish)
21752175
--no-redirect Send output to stderr
21762176
--color[=WHEN] Colorize the output; WHEN can be 'always' (default if

testsuite/modules.00-init/100-pager.exp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ if {$verbose} {
122122
set env(LESS) $opts
123123
pager_test_case "" $pager_dfl_use "-" $install_pager $install_pageropts
124124
pager_test_case "-p" $pager_dfl_use "1" $install_pager $install_pageropts
125-
pager_test_case "--no-pager" 0 "0" $install_pager $install_pageropts
125+
pager_test_case "-P" 0 "0" $install_pager $install_pageropts
126126

127127
set opts ""
128128
if {$verbose} {
@@ -157,7 +157,7 @@ if {$verbose} {
157157
set env(PAGER) $cmd
158158
pager_test_case "" $pager_dfl_use "-" $install_pager $install_pageropts
159159
pager_test_case "-p" $pager_dfl_use "1" $install_pager $install_pageropts
160-
pager_test_case "--no-pager" 0 "0" $install_pager $install_pageropts
160+
pager_test_case "-P" 0 "0" $install_pager $install_pageropts
161161

162162
set cmd "cat"
163163
if {$verbose} {
@@ -184,7 +184,7 @@ if {$verbose} {
184184
set env(PAGER) $cmd
185185
pager_test_case "" $pager_dfl_use "-" $install_pager $install_pageropts
186186
pager_test_case "-p" $pager_dfl_use "1" $install_pager $install_pageropts
187-
pager_test_case "--no-pager" 0 "0" $install_pager $install_pageropts
187+
pager_test_case "-P" 0 "0" $install_pager $install_pageropts
188188

189189
set cmd "/usr/bin/less"
190190
if {$verbose} {
@@ -233,7 +233,7 @@ if {$verbose} {
233233
set env(MODULES_PAGER) $cmd
234234
pager_test_case "" 0 "-" $cmd ""
235235
pager_test_case "-p" 0 "1" $cmd ""
236-
pager_test_case "--no-pager" 0 "0" $cmd ""
236+
pager_test_case "-P" 0 "0" $cmd ""
237237

238238
set cmd "cat"
239239
if {$verbose} {
@@ -260,7 +260,7 @@ if {$verbose} {
260260
unset env(PAGER)
261261
pager_test_case "" 1 "-" $cmd $opts
262262
pager_test_case "-p" 1 "1" $cmd $opts
263-
pager_test_case "--no-pager" 0 "0" $cmd $opts
263+
pager_test_case "-P" 0 "0" $cmd $opts
264264

265265
if {$verbose} {
266266
send_user "\tSetup LESS = '-K'\n"
@@ -280,7 +280,7 @@ if {$verbose} {
280280
set env(MODULES_PAGER) $cmd
281281
pager_test_case "" 1 "-" $cmd $opts
282282
pager_test_case "-p" 1 "1" $cmd $opts
283-
pager_test_case "--no-pager" 0 "0" $cmd $opts
283+
pager_test_case "-P" 0 "0" $cmd $opts
284284

285285

286286
# test activation depending on selected shell

0 commit comments

Comments
 (0)