fix: -h short flag now works on subcommands.

This commit is contained in:
2026-06-25 18:02:09 -04:00
parent c5020bd6a6
commit 6ec09309dd
3 changed files with 3 additions and 3 deletions

View File

@@ -20,7 +20,7 @@
10. Pass allocator to findr? 10. Pass allocator to findr?
11. `-h` short flag seems to fail, at least with `envr list` 11. Smarter flag parsing?
12. Rewrite `write_command_help` to use text/tables 12. Rewrite `write_command_help` to use text/tables

View File

@@ -123,7 +123,7 @@ parse_args :: proc(args: []string, out: io.Stream, err: io.Stream) -> (cmd: Comm
cmd.config_path = default_config_path(home, context.temp_allocator) cmd.config_path = default_config_path(home, context.temp_allocator)
} }
if has_flag(&cmd, "help") { if has_flag(&cmd, "help") || has_flag(&cmd, "h") {
print_command_help(&cmd) print_command_help(&cmd)
return cmd, false return cmd, false
} }

View File

@@ -196,7 +196,7 @@ test_db_serialize :: proc(t: ^testing.T) {
db_insert(&db, f) db_insert(&db, f)
sz: i64 sz: i64
data := sqlite.serialize(db.conn, "main", &sz, 0) data := sqlite.serialize(db.conn, "main", &sz, {})
testing.expect(t, data != nil, "serialize should return non-nil") testing.expect(t, data != nil, "serialize should return non-nil")
if data == nil do return if data == nil do return
defer sqlite.free(data) defer sqlite.free(data)