Skip to content

Commit

Permalink
Upgrade jcli version
Browse files Browse the repository at this point in the history
  • Loading branch information
lempiji committed Dec 23, 2021
1 parent 8064de7 commit ba7a6bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ name "md"
description "A tool for executing sources in Markdown."
authors "lempiji"
license "MIT"
dependency "jcli" version="~>0.12.0"
dependency "jcli" version="~>0.24.0"
dependency "commonmark-d" version="~>1.0.8"
3 changes: 1 addition & 2 deletions dub.selections.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"fileVersion": 1,
"versions": {
"commonmark-d": "1.0.8",
"jcli": "0.12.0",
"jioc": "0.2.0",
"jcli": "0.24.0",
"silly": "1.0.2"
}
}
14 changes: 7 additions & 7 deletions source/commands/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import std.range;
@CommandDefault("Execute code block in markdown.")
struct DefaultCommand
{
@CommandPositionalArg(0, "file", "Markdown file (.md)")
@ArgPositional("file", "Markdown file (.md)")
Nullable!string file;

@CommandArgGroup("Options")
@ArgGroup("Options")
{
@CommandNamedArg("quiet|q", "Only print warnings and errors")
@ArgNamed("quiet|q", "Only print warnings and errors")
Nullable!bool quiet;

@CommandNamedArg("verbose|v", "Print diagnostic output")
@ArgNamed("verbose|v", "Print diagnostic output")
Nullable!bool verbose;
}

Expand Down Expand Up @@ -105,15 +105,15 @@ struct DefaultCommand
}

if (!quiet.get(false))
UserIO.logInfof("Total blocks: %d", totalCount);
stdout.writefln!"Total blocks: %d"(totalCount);
if (errorCount != 0)
{
UserIO.logErrorf("Errors: %d", errorCount);
stderr.writefln!"Errors: %d"(errorCount);
return 1;
}

if (!quiet.get(false))
UserIO.logInfof("Success all blocks.");
stdout.writeln("Success all blocks.");
return 0;
}
}
Expand Down

0 comments on commit ba7a6bf

Please sign in to comment.