aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-11-22 21:47:54 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-11-22 21:48:50 -0500
commit7869c7447a181316abbdd0e4ff9c4331d56a1984 (patch)
tree58b2387259fde1f8d6b06a6fc343e5b36a2f0c20
parentbb354d6d3626cdc0c2a1b802a954df244cd1facc (diff)
Fix command line aliases
-rw-r--r--CHANGES.md1
-rw-r--r--src/compile/cli.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGES.md b/CHANGES.md
index 22a1249b..396e4a84 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -55,6 +55,7 @@
`foo.baz.method()` when `foo` is a `&Foo` and `baz.method()` takes a `&Baz`.
- Optional paths no longer fail to compile when you check them for `none`.
- Text replacement no longer infinitely loops when given an empty text to replace.
+ - Short CLI flag aliases now no longer use the first letter of the argument.
## v0.3
diff --git a/src/compile/cli.c b/src/compile/cli.c
index e3d2329f..e5756521 100644
--- a/src/compile/cli.c
+++ b/src/compile/cli.c
@@ -144,7 +144,7 @@ Text_t compile_cli_arg_call(env_t *env, Text_t fn_name, type_t *fn_type, const c
code = Texts(code, "{", quoted_text(Text$replace(Text$from_str(arg->name), Text("_"), Text("-"))), ", &",
Texts("_$", Text$from_str(arg->name)), ", ", compile_type_info(arg->type),
arg->default_val ? Text("") : Text(", .required=true"),
- arg->alias ? Texts(", .short_flag=", quoted_text(Text$from_str(arg->name)),
+ arg->alias ? Texts(", .short_flag=", quoted_text(Text$from_str(arg->alias)),
"[0]") // TODO: escape char properly
: Text(""),