feat(write): Add support for templates

This commit is contained in:
Glenn Y. Rolland 2023-04-27 10:02:35 +02:00
parent 5689929c83
commit 615c377623
2 changed files with 6 additions and 1 deletions

View file

@ -11,12 +11,16 @@ module DocMachine::Write
config = Config.new(parent_config)
opts.on("write", "Write content target for plan (beta)") do
opts.banner = "Usage: #{PROGRAM_NAME} scaffold [options] TARGET"
opts.banner = "Usage: #{PROGRAM_NAME} write [options] TARGET"
opts.on("-f", "--force", "Don't ask for confirmation") do
config.force = true
end
opts.on("-t", "--template TEMPLATE", "Use given template") do |template_name|
config.template_name = template_name
end
commands << ->() : Nil do
Log.debug { "before any" }
if args.size < 1

View file

@ -6,6 +6,7 @@ module DocMachine::Write
property target_directory : String = "."
property force : Bool = false
property template_name : String = ""
def initialize(@parent : DocMachine::Config)
end