All checks were successful
continuous-integration/drone/push Build is passing
36 lines
854 B
Crystal
36 lines
854 B
Crystal
require "./config"
|
|
require "./run"
|
|
|
|
module DocMachine::Write
|
|
Log = DocMachine::Log.for("write")
|
|
|
|
class Cli
|
|
Log = DocMachine::Write::Log.for("cli")
|
|
|
|
def self.add_options(opts, args, parent_config, commands)
|
|
config = Config.new(parent_config)
|
|
|
|
opts.on("write", "Write content target for plan (beta)") do
|
|
opts.banner = "Usage: #{PROGRAM_NAME} scaffold [options] TARGET"
|
|
|
|
opts.on("-f", "--force", "Don't ask for confirmation") do
|
|
config.force = true
|
|
end
|
|
|
|
commands << ->() : Nil do
|
|
if args.size < 1
|
|
Log.error { "ERROR: No target given!" }
|
|
exit 1
|
|
end
|
|
config.target_directory = args[0]
|
|
|
|
app = DocMachine::Write::Run.new(config)
|
|
app.prepare
|
|
app.start
|
|
app.wait
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|