diff --git a/dub.sdl b/dub.sdl index a59b8ea..24e18e4 100644 --- a/dub.sdl +++ b/dub.sdl @@ -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" diff --git a/dub.selections.json b/dub.selections.json index 3bae06f..c74ddc2 100644 --- a/dub.selections.json +++ b/dub.selections.json @@ -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" } } diff --git a/source/commands/main.d b/source/commands/main.d index 5819b42..c7e95e7 100644 --- a/source/commands/main.d +++ b/source/commands/main.d @@ -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; } @@ -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; } }