bin/hyla in hyla-1.0.3 vs bin/hyla in hyla-1.0.4

- old
+ new

@@ -16,11 +16,11 @@ program :description, Hyla::DESCRIPTION default_command :default def add_build_options(c) - c.option '-c','--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file' + c.option '-c','--config CONFIG_FILE', String, 'Custom configuration file' c.option '-V','--verbose', 'Print verbose output.' end def add_common_options(c) c.option '-s', '--source [DIR]', String, 'Source directory (defaults to ./)' @@ -33,34 +33,36 @@ command :new do |c| c.syntax = 'hyla new [options]' c.description = 'Creates a new Hyla project using a template or blank to the PATH specified' c.option '-f','--force', 'Force creation even if PATH already exists' c.option '-b','--blank', 'Creates project but with empty files' - c.option '-','--template_type [TEMPLATE_TYPE]', String, 'Template Type to be used (documentation, book, training, training-exercises, blog, web, ...)' + c.option '--t','--template_type [TEMPLATE_TYPE]', String, 'Template Type to be used (documentation, book, training, training-exercises, blog, web, ...)' add_common_options(c) + add_build_options(c) c.action do |args, options| config = Hyla::Configuration.parse(options.__hash__) Hyla::Commands::New.process(args, config) end end # # Creates a new file from an artefact within an existing project # -command :create do |c| - c.syntax = 'hyla create [options]' - c.description = 'Creates a new file from asciidoc artefact for an existing project' +command :add do |c| + c.syntax = 'hyla add [options]' + c.description = 'Add a new file using one of the different asciidoc samples/artefacts' c.option '-a', '--artefact_type [ARTEFACT_TYPE]', String, 'Artefact Type : article, audio, video, blog entry ...' c.option '--t', '--type [TYPE]', String, 'Type : asciidoc, slideshow' add_common_options(c) + add_build_options(c) c.action do |args, options| config = Hyla::Configuration.parse(options.__hash__) - Hyla::Commands::Create.process(args, config) + Hyla::Commands::Add.process(args, config) end end # # Generate from asciidoc files content according to rendering/transformation requested @@ -69,16 +71,17 @@ c.syntax = 'hyla generate [OPTIONS]' c.description = 'Generate content from asciidoc files (Table Of Content, modules, ...) to HTML, Slideshow' c.option '-b', '--backend [BACKEND]', String, 'Backend to be used : HTML5, deckjs, revealjs, ...' c.option '-f', '--file [HTML FILE]', String, 'HTML File name' c.option '-p', '--project_name [PROJECT_NAME]', String, 'Project Name' - c.option '-r', '--rendering [RENDERING]', String, 'Code of the rendering : adoc2html, adoc2htmlslide, toc2adoc, index2htmlslide, html2pdf' + c.option '-r', '--rendering [RENDERING]', String, 'Code of the rendering : adoc2html, index2html, html2pdf, toc2adoc' c.option '--t', '--toc [PATH]', String, 'File Path of the asciidoc file containing the Table of Content' c.option '-y', '--style [STYLE]', String, 'Stylesheet theme to be applied : asciidoctor, liberation, github, colony, foundation, ...' c.option '-a', '--attributes [KEY=VALUE,KEY=VALUE]', String, 'Asciidoctor attributes' add_common_options(c) + add_build_options(c) c.action do |args, options| config = Hyla::Configuration.parse(options.__hash__) Hyla::Commands::Generate.process(args, config) end @@ -86,11 +89,13 @@ # Watch command :watch do |c| c.syntax = 'hyla watch [options]' c.description = 'Watch directories for any change, add or file deleted and render document (HTML5)' + add_common_options(c) + add_build_options(c) c.action do |args, options| # TODO Find if it is possible to watch files, generate HTML content - asciidoctor, expose content using HTTPServer and expose WebSocket - LiveReload # as they are started in 2 different threads, this is not possible with existing code @@ -108,15 +113,18 @@ c.option '-out_dir DIR', String, 'Output directory where content must be generated' c.option '-B', '--detach', 'Run the server in the background (detach)' c.option '-P', '--port [PORT]', 'Port to listen on' c.option '-H', '--host [HOST]', 'Host to bind to' c.option '-b', '--baseurl [URL]', 'Base URL' + add_common_options(c) + add_build_options(c) c.action do |args, options| options.default :serving => true - Hyla::Commands::Serve.process(args, options.__hash__) + config = Hyla::Configuration.parse(options.__hash__) + Hyla::Commands::Serve.process(args, config) end end alias_command :server, :serve # @@ -125,14 +133,19 @@ command :sendmail do |c| c.syntax = 'hyla sendmail [options]' c.description = 'Send as HTML Attachment an email to the SMTP Server defined' c.option '-f', '--file [File]', String, 'File to be attached' c.option '-l', '--location [PATH]', String, 'Directory containing file to be attached' + c.option '-a', '--attachment [boolean]', 'Attach to the email the HTML generated' c.option '-e', '--email_attributes [KEY=VALUE,KEY=VALUE]', String, 'Email attributes used to configure smtp server, port number, user password, authentication mode, sender, recipient, subject' add_common_options(c) + add_build_options(c) c.action do |args, options| + + options.default :attachment => false + config = Hyla::Configuration.parse(options.__hash__) Hyla::Commands::Sendmail.process(args, config) end end