Skip to content

Commit

Permalink
Merge pull request #25 from cgay/dev
Browse files Browse the repository at this point in the history
A few small fixes
  • Loading branch information
cgay authored Feb 15, 2022
2 parents 738fc84 + 908d056 commit 6cb195a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 6 additions & 3 deletions help.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ define function print-help
if (~empty?(names))
let name-width = reduce1(max, map(size, names));
for (name in names, doc in docs)
format(stream, "%s %s\n", pad-right(name, name-width), doc);
if (empty?(doc))
format(stream, "%s\n", name);
else
format(stream, "%s %s\n", pad-right(name, name-width), doc);
end;
end;
end;
format(stream, "\n");
Expand Down Expand Up @@ -256,9 +260,8 @@ define function subcommand-columns
add!(docs, subcmd.command-help);
if (subcmd.has-subcommands?)
loop(subcmd.command-subcommands, concatenate(indent, " "));
else
loop(tail(subs), indent)
end;
loop(tail(subs), indent)
end;
end iterate;
values(names, docs)
Expand Down
10 changes: 10 additions & 0 deletions pkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"category": "utilities",
"contact": "dylan-lang@googlegroups.com",
"deps": ["strings@1.0"],
"description": "Command line processing",
"keywords": ["cli", "flags"],
"name": "command-line-parser",
"version": "3.1.0",
"url": "https://github.com/dylan-lang/command-line-parser"
}

0 comments on commit 6cb195a

Please sign in to comment.