feat(write): Add support for templates
This commit is contained in:
parent
5689929c83
commit
615c377623
2 changed files with 6 additions and 1 deletions
|
@ -11,12 +11,16 @@ module DocMachine::Write
|
||||||
config = Config.new(parent_config)
|
config = Config.new(parent_config)
|
||||||
|
|
||||||
opts.on("write", "Write content target for plan (beta)") do
|
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
|
opts.on("-f", "--force", "Don't ask for confirmation") do
|
||||||
config.force = true
|
config.force = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.on("-t", "--template TEMPLATE", "Use given template") do |template_name|
|
||||||
|
config.template_name = template_name
|
||||||
|
end
|
||||||
|
|
||||||
commands << ->() : Nil do
|
commands << ->() : Nil do
|
||||||
Log.debug { "before any" }
|
Log.debug { "before any" }
|
||||||
if args.size < 1
|
if args.size < 1
|
||||||
|
|
|
@ -6,6 +6,7 @@ module DocMachine::Write
|
||||||
|
|
||||||
property target_directory : String = "."
|
property target_directory : String = "."
|
||||||
property force : Bool = false
|
property force : Bool = false
|
||||||
|
property template_name : String = ""
|
||||||
|
|
||||||
def initialize(@parent : DocMachine::Config)
|
def initialize(@parent : DocMachine::Config)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue