summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorgan Smith2023-05-30 12:16:52 -0400
committerArun Isaac2023-05-30 20:33:43 +0100
commit207413e6ea2a17542711c306e6dbdbedc4ed0eaf (patch)
treede3dfe45240f713d73a1853bf56fd83923111d0c
parentfdc7646d150995fddd9b769370a54bca1f094e28 (diff)
downloadtissue-207413e6ea2a17542711c306e6dbdbedc4ed0eaf.tar.gz
tissue-207413e6ea2a17542711c306e6dbdbedc4ed0eaf.tar.lz
tissue-207413e6ea2a17542711c306e6dbdbedc4ed0eaf.zip
bin: Enable use of pagers other then less.
Previous logic assumed that the pager could accept the command line argument "--raw". Replace this logic by setting the environment variable "LESS". This idea is inspired by git. * bin/tissue (main): Set "LESS" environment variable. (tissue-search): Don't run pager with "--raw" argument. Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
-rwxr-xr-xbin/tissue9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/tissue b/bin/tissue
index 1355f53..7e10d16 100755
--- a/bin/tissue
+++ b/bin/tissue
@@ -4,6 +4,7 @@ exec guile --no-auto-compile -s "$0" "$@"
;;; tissue --- Text based issue tracker
;;; Copyright © 2022, 2023 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2023 Morgan Smith <Morgan.J.Smith@outlook.com>
;;;
;;; This file is part of tissue.
;;;
@@ -96,8 +97,7 @@ Search issues using SEARCH-QUERY.
(lambda (port)
(search-map (cut print <> <> port) db (string-join args)))
(or (getenv "PAGER")
- "less")
- "--raw"))))))
+ "less")))))))
(define tissue-show
(match-lambda*
@@ -500,6 +500,11 @@ Pull latest from upstream repositories.
(display (condition-message c) (current-error-port))
(newline (current-error-port))
(exit #f)))
+ ;; Unless LESS is already configured, pass command-line options to
+ ;; less by setting LESS. This idea is inspired by
+ ;; git. https://git-scm.com/docs/git-config#git-config-corepager
+ (unless (getenv "LESS")
+ (setenv "LESS" "FRX"))
;; Add the top level of the git repository to the load path since
;; there may be user-written modules in the repository.
(match args