]> git.lizzy.rs Git - plan9front.git/commit
aux/getflags: improve flagfmt parser
authorkvik <kvik@a-b.xyz>
Wed, 6 May 2020 22:10:09 +0000 (00:10 +0200)
committerkvik <kvik@a-b.xyz>
Wed, 6 May 2020 22:10:09 +0000 (00:10 +0200)
commitccf5d3fb9db7e58a9b9177f41edaf045b9294f86
tree10b775fb9078d2924063a99a54e3efc2ea8b2266
parent0dc9c8d0199db2746f2ca651911e8fa60e90e02f
aux/getflags: improve flagfmt parser

This makes the flagfmt parser more robust and accepting
a looser input language — namely by allowing whitespace
around specifier fields and ignoring any empty fields.

Long flagfmts can thus be pleasingly displayed:

flagfmt='
a, b, c, C:cache,
m:mtpt mountpoint,
s:srvn srvname'
sys/man/8/getflags
sys/src/cmd/aux/getflags.c
sys/src/cmd/aux/usage.c