xaizek / zograscope (License: AGPLv3 only) (since 2018-12-07)
Mainly a syntax-aware diff that also provides a number of additional tools.
Commit 31813a3284a07a572c246ba19b5046e015c78f3d

Add --no-pager common command-line parameter
Disables spawning a pager for output.
Author: xaizek
Author date (UTC): 2022-07-19 17:26
Committer name: xaizek
Committer date (UTC): 2022-07-19 17:26
Parent(s): d2a30cdb9129d4afa80938ed7fb365d1a247210c
Signing key: 99DC5E4DB05F6BE2
Tree: 48e8bd824075927e7a6c917c2cc9265d0be1334e
File Lines added Lines deleted
docs/zograscope.md 6 2
man/zograscope.7 8 1
src/tooling/common.cpp 6 0
src/tooling/common.hpp 1 0
File docs/zograscope.md changed (mode: 100644) (index 91ac703..8c1796c)
... ... force colorization of output
233 233 `--lang` _arg_ \ `--lang` _arg_ \
234 234 force specific language (`c`, `cxx`, `make`, `lua`) and disable auto-detection force specific language (`c`, `cxx`, `make`, `lua`) and disable auto-detection
235 235
236 `--no-pager` \
237 never spawn a pager for output
238
236 239 BEHAVIOUR BEHAVIOUR
237 240 ========= =========
238 241
239 242 Pager Pager
240 243 ----- -----
241 244
242 When output is a terminal (not the case when invoked by Git), `less` is spawn
243 if output is about the size of the screen.
245 By default when output is a terminal (not the case when invoked by Git), `less`
246 is spawn if output is about the size of the screen. Use `--no-pager` to change
247 the behaviour.
244 248
245 249 Language detection Language detection
246 250 ------------------ ------------------
File man/zograscope.7 changed (mode: 100644) (index 42700d8..e9b648a)
... ... force colorization of output
334 334 .PD .PD
335 335 force specific language (\f[V]c\f[R], \f[V]cxx\f[R], \f[V]make\f[R], force specific language (\f[V]c\f[R], \f[V]cxx\f[R], \f[V]make\f[R],
336 336 \f[V]lua\f[R]) and disable auto-detection \f[V]lua\f[R]) and disable auto-detection
337 .PP
338 \f[V]--no-pager\f[R]
339 .PD 0
340 .P
341 .PD
342 never spawn a pager for output
337 343 .SH BEHAVIOUR .SH BEHAVIOUR
338 344 .SS Pager .SS Pager
339 345 .PP .PP
340 When output is a terminal (not the case when invoked by Git),
346 By default when output is a terminal (not the case when invoked by Git),
341 347 \f[V]less\f[R] is spawn if output is about the size of the screen. \f[V]less\f[R] is spawn if output is about the size of the screen.
348 Use \f[V]--no-pager\f[R] to change the behaviour.
342 349 .SS Language detection .SS Language detection
343 350 .PP .PP
344 351 By default language is auto-detected based on file name. By default language is auto-detected based on file name.
File src/tooling/common.cpp changed (mode: 100644) (index 98d3175..cdaa5d9)
... ... Environment::setup(const std::vector<std::string> &argv)
66 66 args.color = varMap.count("color"); args.color = varMap.count("color");
67 67 args.fine = varMap.count("fine-only"); args.fine = varMap.count("fine-only");
68 68 args.timeReport = varMap.count("time-report"); args.timeReport = varMap.count("time-report");
69 args.noPager = varMap.count("no-pager");
69 70 args.lang = varMap["lang"].as<std::string>(); args.lang = varMap["lang"].as<std::string>();
70 71
71 72 if (args.color) { if (args.color) {
72 73 decor::enableDecorations(); decor::enableDecorations();
73 74 } }
75
76 if (args.noPager) {
77 redirectToPager.discharge();
78 }
74 79 } }
75 80
76 81 // Parses command line-options. // Parses command line-options.
 
... ... parseOptions(const std::vector<std::string> &args,
98 103 ("dump-stree", "display stree(s)") ("dump-stree", "display stree(s)")
99 104 ("dump-tree", "display tree(s)") ("dump-tree", "display tree(s)")
100 105 ("time-report", "report time spent on different activities") ("time-report", "report time spent on different activities")
106 ("no-pager", "never spawn a pager for output")
101 107 ("fine-only", "use only fine-grained tree") ("fine-only", "use only fine-grained tree")
102 108 ("color", "force colorization of output") ("color", "force colorization of output")
103 109 ("lang", po::value<std::string>()->default_value({}), ("lang", po::value<std::string>()->default_value({}),
File src/tooling/common.hpp changed (mode: 100644) (index b68da71..37b6983)
... ... struct CommonArgs
50 50 bool color; // Fine-grained tree. bool color; // Fine-grained tree.
51 51 bool fine; // Whether to build only fine-grained tree. bool fine; // Whether to build only fine-grained tree.
52 52 bool timeReport; // Print time report. bool timeReport; // Print time report.
53 bool noPager; // Don't spawn a pager.
53 54 }; };
54 55
55 56 class Environment class Environment
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/zograscope

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/zograscope

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master