From f0130ab1a1e65583637b6a362b879ea3253e7bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc?= Date: Sat, 19 Oct 2024 18:44:22 +0200 Subject: [PATCH 1/2] doc: replace `-?` with `-h` for bench_bitcoin help 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 work 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. \ --- doc/benchmarking.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/benchmarking.md b/doc/benchmarking.md index c6dc75dc5cd..8f836219c92 100644 --- a/doc/benchmarking.md +++ b/doc/benchmarking.md @@ -40,7 +40,7 @@ The output will look similar to: Help --------------------- - build/src/bench/bench_bitcoin -? + build/src/bench/bench_bitcoin -h To print the various options, like listing the benchmarks without running them or using a regex filter to only run certain benchmarks. From 33a28e252a7349c0aa284005aee97873b965fcfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc?= Date: Mon, 21 Oct 2024 11:03:28 +0200 Subject: [PATCH 2/2] Change default help arg to `-help` and mention `-h` and `-?` as alternatives % build/src/bench/bench_bitcoin -h [...] -help Print this help message and exit (also -h or -?) --- src/common/args.cpp | 4 ++-- test/lint/check-doc.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/args.cpp b/src/common/args.cpp index f59d2b8f0fc..ce80fbbc0a8 100644 --- a/src/common/args.cpp +++ b/src/common/args.cpp @@ -688,8 +688,8 @@ bool HelpRequested(const ArgsManager& args) void SetupHelpOptions(ArgsManager& args) { - args.AddArg("-?", "Print this help message and exit", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); - args.AddHiddenArgs({"-h", "-help"}); + args.AddArg("-help", "Print this help message and exit (also -h or -?)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); + args.AddHiddenArgs({"-h", "-?"}); } static const int screenWidth = 79; diff --git a/test/lint/check-doc.py b/test/lint/check-doc.py index f55d0f8cb7b..3e9e5ba230a 100755 --- a/test/lint/check-doc.py +++ b/test/lint/check-doc.py @@ -23,7 +23,7 @@ CMD_GREP_WALLET_ARGS = r"git grep --function-context 'void WalletInit::AddWallet CMD_GREP_WALLET_HIDDEN_ARGS = r"git grep --function-context 'void DummyWalletInit::AddWalletOptions' -- {}".format(CMD_ROOT_DIR) CMD_GREP_DOCS = r"git grep --perl-regexp '{}' {}".format(REGEX_DOC, CMD_ROOT_DIR) # list unsupported, deprecated and duplicate args as they need no documentation -SET_DOC_OPTIONAL = set(['-h', '-help', '-dbcrashratio', '-forcecompactdb']) +SET_DOC_OPTIONAL = set(['-h', '-?', '-dbcrashratio', '-forcecompactdb']) def lint_missing_argument_documentation():