summaryrefslogtreecommitdiff
path: root/sys/src/cmd/aux/usage.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2020-04-18 15:38:38 -0700
committerOri Bernstein <ori@eigenstate.org>2020-04-18 15:38:38 -0700
commit380adf8b485ce93aa42ad0d414718c3ad4918176 (patch)
tree56d17c000f93a33c5002108d71fda066a11a5d96 /sys/src/cmd/aux/usage.c
parent8ae77554dda425997faa8c7562613cc06586a209 (diff)
aux/getflags: support named flags
When using aux/getflags, it produces unnecessarily obscure names for the flags. This allows the caller of aux/getflags to support arbitrary names.
Diffstat (limited to 'sys/src/cmd/aux/usage.c')
-rw-r--r--sys/src/cmd/aux/usage.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/src/cmd/aux/usage.c b/sys/src/cmd/aux/usage.c
index 6d58577f4..a2f8c7c2c 100644
--- a/sys/src/cmd/aux/usage.c
+++ b/sys/src/cmd/aux/usage.c
@@ -31,6 +31,9 @@ main(void)
single = 0;
for(p=flags; *p; ){
p += chartorune(&r, p);
+ if(*p == ':')
+ while(*p != '\0' && *p != ',' && *p != ' ')
+ p++;
if(*p == ',' || *p == 0){
if(!single){
fmtprint(&fmt, " [-");