X-Git-Url: https://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/da99716d86d4870be554d8412b41a751583da661..c3f53b697f5dd5ecd5a5f74e94ec0fd55b0f2764:/scripts/gen-options.awk diff --git a/scripts/gen-options.awk b/scripts/gen-options.awk index f2cdfe7..450f85c 100755 --- a/scripts/gen-options.awk +++ b/scripts/gen-options.awk @@ -181,7 +181,7 @@ $0 ~ /^-/ { # packed form is not possible w/ actions has_actions = 1; - n = split(work, a, /,[ \t]*/) + n = split(work, a, ",[ \t]*") if (n == 2) { flag = substr(a[1], 2) ", " substr(a[2], 1, length(a[2])-1) } else if (n == 1) { @@ -213,11 +213,10 @@ $0 ~ /^-/ { } # Ignore any line beginning with a # -$0 ~ /^#/ { next } +$0 ~ /^#/ { next; } -lopt { - sub(/^[ \t]*/, "") - if (!$0) { next } +NF && lopt != "" { + sub(/^[ \t]*/, ""); if (lopt in optionhelp) $0 = "\n" $0;