summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2018-05-03 17:15:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-04 05:35:38 (GMT)
commit7213c288187bd9ef1e32e4f86c20c55436f1ae90 (patch)
tree8f16c0797da9891af7377fcce5fb9b24bc985a38 /git.c
parent468165c1d8a442994a825f3684528361727cd8c0 (diff)
downloadgit-7213c288187bd9ef1e32e4f86c20c55436f1ae90.zip
git-7213c288187bd9ef1e32e4f86c20c55436f1ae90.tar.gz
git-7213c288187bd9ef1e32e4f86c20c55436f1ae90.tar.bz2
git: add -P as a short option for --no-pager
It is possible to configure 'less', the pager, to use an alternate screen to show the content, for example, by setting LESS=RS in the environment. When it is closed in this configuration, it switches back to the original screen, and all content is gone. It is not uncommon to request that the output remains visible in the terminal. For this, the option --no-pager can be used. But it is a bit cumbersome to type, even when command completion is available. Provide a short option, -P, to make the option more easily accessible. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git.c')
-rw-r--r--git.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/git.c b/git.c
index ceaa58e..71d0134 100644
--- a/git.c
+++ b/git.c
@@ -7,7 +7,7 @@
const char git_usage_string[] =
N_("git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
- " [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]\n"
+ " [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
" <command> [<args>]");
@@ -81,7 +81,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
exit(0);
} else if (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) {
use_pager = 1;
- } else if (!strcmp(cmd, "--no-pager")) {
+ } else if (!strcmp(cmd, "-P") || !strcmp(cmd, "--no-pager")) {
use_pager = 0;
if (envchanged)
*envchanged = 1;