34 lines
822 B
Crystal
34 lines
822 B
Crystal
|
|
||
|
require "./config"
|
||
|
|
||
|
module DocMachine::Builder
|
||
|
class Cli
|
||
|
def self.add_options(opts, parent_config)
|
||
|
config = Config.new(parent_config)
|
||
|
|
||
|
opts.on("build", "Build content and produce deliverables") do
|
||
|
opts.banner = [
|
||
|
"Usage: #{PROGRAM_NAME} build [options]",
|
||
|
"",
|
||
|
"Main options:"
|
||
|
].join("\n")
|
||
|
|
||
|
opts.separator ""
|
||
|
opts.separator "Builder Options:"
|
||
|
|
||
|
opts.on("-d", "--data-dir DIR", "Content directory") do |dir|
|
||
|
config.data_dir = dir
|
||
|
end
|
||
|
|
||
|
opts.on("-a", "--action ACTION", "Action (watch, build, shell, etc.)") do |action|
|
||
|
config.action = action
|
||
|
end
|
||
|
|
||
|
opts.on("-t", "--tty", "Enable TTY mode (needed for shell)") do
|
||
|
config.enable_tty = true
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|