ww: resolve root argv0 and retire stale help paths

This commit is contained in:
2026-08-09 03:56:37 +09:00
parent 5f829399ea
commit 00d0ed502d
3 changed files with 83 additions and 18 deletions

View File

@@ -20,13 +20,12 @@ static const char *usage =
" build [-S] [-w DIR] [-o FILE] [path] compile module; -S stops after package asm\n"
" run [path] ... build then exec, passing extra args to the program\n"
" test [-S -o STEM] [-w DIR] [options] [path] build/run tests; -S emits package asm\n"
" fmt <path> reformat ww source\n"
" version print version and exit\n"
"\n"
" path forms:\n"
" foo.ww literal file\n"
" foo search cwd, -I dirs, then $WW_LIB for foo.ww or foo/foo.ww\n"
" lib/foo directory: build lib/foo/foo.ww\n"
" foo search cwd, -I dirs, then the source library for foo.ww or foo/\n"
" lib/foo directory: build its package sources\n"
" lib/... every package under lib, recursively (test only)\n"
" . build the cwd's <basename>.ww\n";
@@ -1865,14 +1864,6 @@ do_test(int argc, char **argv)
return exec_package_tests(argc, argv, src, NULL, src == NULL);
}
static int
do_fmt(int argc, char **argv)
{
(void)argc; (void)argv;
fputs("ww: fmt: not implemented in this phase\n", stderr);
return 1;
}
int
main(int argc, char **argv)
{
@@ -1891,7 +1882,6 @@ main(int argc, char **argv)
if (strcmp(cmd, "build") == 0) return do_build(argc - 2, argv + 2);
if (strcmp(cmd, "run") == 0) return do_run(argc - 2, argv + 2);
if (strcmp(cmd, "test") == 0) return do_test(argc - 2, argv + 2);
if (strcmp(cmd, "fmt") == 0) return do_fmt(argc - 2, argv + 2);
fprintf(stderr, "ww: unknown subcommand: %s\n", cmd);
fputs(usage, stderr);
return 2;