Skip to content

Commit

Permalink
make cli options print a little prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Aug 1, 2024
1 parent b353a86 commit 2727d5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions source/adapters/dap.d
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ Llisten:
send(j);
}

private
void send(ref JSONValue json)
{
super.send(cast(ubyte[])json.toString());
Expand Down
12 changes: 10 additions & 2 deletions source/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,17 @@ void main(string[] args)

if (gres.helpWanted)
{
static immutable int optpad = -16;
gres.options[$-1].help = "Show this help page and quit";
defaultGetoptPrinter("Debugger server", gres.options);
return;
writeln("Debugger server\n\nOptions:");
foreach (Option opt; gres.options)
{
with (opt) if (optShort)
writefln(" %s, %*s %s", optShort, optpad, optLong, help);
else
writefln(" %*s %s", optpad, optLong, help);
}
exit(0);
}

// Setup logger
Expand Down

0 comments on commit 2727d5f

Please sign in to comment.