Skip to content

A few small fixes #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}