kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

commit d72d3e9d7c53bf41dc81145c34137f9abbaec07a
parent 820986504df734a62104d7457878c353ea91e2cf
Author: Ryan Sepassi <rsepassi@gmail.com>
Date:   Thu, 16 Jul 2026 10:50:27 -0700

install: preserve documented no-argument help

Diffstat:
Mdriver/cmd/install.c | 8+++-----
Mtest/driver/run.sh | 2+-
2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/driver/cmd/install.c b/driver/cmd/install.c @@ -36,6 +36,8 @@ void driver_help_install(void) { " names (cc, ld, nm, ...) as a drop-in toolchain. Entries are\n" " symlinks on POSIX and hard links on Windows by default.\n" "\n" + " With no arguments, prints this help without changing anything.\n" + "\n" " With no TOOL given, installs the default set: the binutils/compiler\n" " toolchain (cc cpp as ld ar ranlib strip objcopy objdump nm size\n" " addr2line strings) plus the standard-named byte utilities (xxd cmp\n" @@ -86,14 +88,10 @@ int driver_install(int argc, char** argv) { unsigned done_count = 0, failures = 0; int i, rc = 2; - if (driver_argv_wants_help(argc, argv, 1)) { + if (argc < 2 || driver_argv_wants_help(argc, argv, 1)) { driver_help_install(); return 0; } - if (argc < 2) { - driver_errf(INSTALL_TOOL, "missing target directory"); - return 2; - } driver_env_init(&env); diff --git a/test/driver/run.sh b/test/driver/run.sh @@ -1633,7 +1633,7 @@ else ok "install-explicit-only-listed" fi run_fail "install-unknown-tool" "$KIT" install "$work/inst-bad" bogustool -run_fail "install-missing-dir" "$KIT" install +run_ok "install-noargs-help" "$KIT" install # A hard link shares the binary's inode (the `-ef` test compares st_dev+st_ino). inst_hard="$work/inst-hard"