Skip to content

Commit

Permalink
Merge pull request #80 from Kapendev/master
Browse files Browse the repository at this point in the history
fixed help and changed no args behavior
  • Loading branch information
adamdruppe authored Oct 14, 2024
2 parents 821b947 + d140eef commit 72a61fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion opend/src/opend.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int main(string[] args) {
foreach(memberName; __traits(allMembers, Commands))
case memberName:
return __traits(getMember, Commands, memberName)(args[2 .. $]);
case "--help":
case "-h", "--help":
import std.stdio, std.string;
foreach(memberName; __traits(allMembers, Commands))
writeln(memberName, "\n\t", strip(__traits(docComment, __traits(getMember, Commands, memberName))));
Expand All @@ -34,7 +34,10 @@ struct Commands {

/// Does a debug build and immediately runs the program
int run(string[] args) {
import std.stdio, std.string;
if(args.length == 0)
foreach(memberName; __traits(allMembers, Commands))
writeln(memberName, "\n\t", strip(__traits(docComment, __traits(getMember, Commands, memberName))));
return 1;
if(auto err = build(args))
return err;
Expand Down

0 comments on commit 72a61fb

Please sign in to comment.