mirror of
https://github.com/sbrow/envr.git
synced 2026-06-27 10:38:33 -04:00
fix: -h short flag now works on subcommands.
This commit is contained in:
2
TODOS.md
2
TODOS.md
@@ -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
|
||||||
|
|
||||||
|
|||||||
2
cli.odin
2
cli.odin
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user