Skip to content

Commit 7640cfd

Browse files
committed
Merge bitcoin#31118: doc: replace -? with -h and -help
33a28e2 Change default help arg to `-help` and mention `-h` and `-?` as alternatives (Lőrinc) f0130ab doc: replace `-?` with `-h` for bench_bitcoin help (Lőrinc) Pull request description: The question mark is interpreted as a wildcard for any single character in Zsh (see https://www.techrepublic.com/article/globbing-wildcard-characters-with-zsh), so `bench_bitcoin -?` will not show the help message on systems using Zsh, such as macOS. Since `-h` provides equivalent help functionality (as defined in https://github.com/bitcoin/bitcoin/blob/master/src/common/args.cpp#L684-L693), the `benchmarking.md` documentation has been updated to ensure compatibility with macOS. ---- ### -? > % cmake -B build -DBUILD_BENCH=ON && cmake --build build && build/src/bench/bench_bitcoin -? zsh: no matches found: -? ### -h > % cmake -B build -DBUILD_BENCH=ON && cmake --build build && build/src/bench/bench_bitcoin -h Usage: bench_bitcoin [options] Options: ... ---- Based on the comments the args help default was also changed to `-help`, mentioning `-h` and `-?` (instead of `-?` being the default) ACKs for top commit: edilmedeiros: tACK 33a28e2 maflcko: lgtm ACK 33a28e2 achow101: ACK 33a28e2 rkrux: tACK bitcoin@33a28e2 laanwj: Code review ACK 33a28e2 Tree-SHA512: 8c6e27488462be9ba9186b34abe6249c1d93026b3963acc0f42c75496f39407563766ae518cf1839156039cc0047e29d91f70d191cfb97e0fbde85665e88c71e
2 parents 74fb193 + 33a28e2 commit 7640cfd

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

doc/benchmarking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The output will look similar to:
4040
Help
4141
---------------------
4242

43-
build/src/bench/bench_bitcoin -?
43+
build/src/bench/bench_bitcoin -h
4444

4545
To print the various options, like listing the benchmarks without running them
4646
or using a regex filter to only run certain benchmarks.

src/common/args.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,8 @@ bool HelpRequested(const ArgsManager& args)
688688

689689
void SetupHelpOptions(ArgsManager& args)
690690
{
691-
args.AddArg("-?", "Print this help message and exit", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
692-
args.AddHiddenArgs({"-h", "-help"});
691+
args.AddArg("-help", "Print this help message and exit (also -h or -?)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
692+
args.AddHiddenArgs({"-h", "-?"});
693693
}
694694

695695
static const int screenWidth = 79;

test/lint/check-doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
CMD_GREP_WALLET_HIDDEN_ARGS = r"git grep --function-context 'void DummyWalletInit::AddWalletOptions' -- {}".format(CMD_ROOT_DIR)
2424
CMD_GREP_DOCS = r"git grep --perl-regexp '{}' {}".format(REGEX_DOC, CMD_ROOT_DIR)
2525
# list unsupported, deprecated and duplicate args as they need no documentation
26-
SET_DOC_OPTIONAL = set(['-h', '-help', '-dbcrashratio', '-forcecompactdb'])
26+
SET_DOC_OPTIONAL = set(['-h', '-?', '-dbcrashratio', '-forcecompactdb'])
2727

2828

2929
def lint_missing_argument_documentation():

0 commit comments

Comments
 (0)