diff --git a/bashly.gemspec b/bashly.gemspec index f92ec0d7..f95ba260 100644 --- a/bashly.gemspec +++ b/bashly.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |s| s.add_dependency 'filewatcher', '~> 2.0' s.add_dependency 'gtx', '~> 0.1.1' s.add_dependency 'lp', '~> 0.2.0' - s.add_dependency 'mister_bin', '~> 0.7.0' + s.add_dependency 'mister_bin', '~> 0.8.1' s.add_dependency 'requires', '~> 1.1' s.add_dependency 'tty-markdown', '~> 0.7.2' diff --git a/lib/bashly/cli.rb b/lib/bashly/cli.rb index d0c56db8..00e09370 100644 --- a/lib/bashly/cli.rb +++ b/lib/bashly/cli.rb @@ -9,15 +9,15 @@ def self.runner header: 'Bashly - Bash CLI Generator', footer: "Help: m`bashly COMMAND --help`\nDocs: bu`https://bashly.dannyb.co`" - runner.route 'init', to: Commands::Init - runner.route 'preview', to: Commands::Preview - runner.route 'validate', to: Commands::Validate - runner.route 'generate', to: Commands::Generate - runner.route 'add', to: Commands::Add - runner.route 'doc', to: Commands::Doc - runner.route 'completions', to: Commands::Completions - runner.route 'render', to: Commands::Render - runner.route 'shell', to: Commands::Shell unless ENV['BASHLY_SHELL'] + runner.route 'init', to: Commands::Init + runner.route 'preview', to: Commands::Preview + runner.route 'validate', to: Commands::Validate + runner.route %w[generate build], to: Commands::Generate + runner.route 'add', to: Commands::Add + runner.route 'doc', to: Commands::Doc + runner.route 'completions', to: Commands::Completions + runner.route 'render', to: Commands::Render + runner.route 'shell', to: Commands::Shell unless ENV['BASHLY_SHELL'] runner end diff --git a/lib/bashly/commands/generate.rb b/lib/bashly/commands/generate.rb index 5553bc2a..afc1b768 100644 --- a/lib/bashly/commands/generate.rb +++ b/lib/bashly/commands/generate.rb @@ -3,7 +3,8 @@ module Bashly module Commands class Generate < Base - help 'Generate the bash script and required files' + summary "Generate the bash script and required files" + help "This command is also aliased as 'build'" usage 'bashly generate [options]' usage 'bashly generate (-h|--help)' @@ -22,6 +23,7 @@ class Generate < Base example 'bashly generate --force' example 'bashly generate --wrap my_function' + example 'bashly build --watch --env production' example 'bashly g -uw' attr_reader :watching diff --git a/spec/approvals/cli/generate/help b/spec/approvals/cli/generate/help index 5a930dff..cefbaad0 100644 --- a/spec/approvals/cli/generate/help +++ b/spec/approvals/cli/generate/help @@ -1,5 +1,7 @@ Generate the bash script and required files +This command is also aliased as 'build' + Usage: bashly generate [options] bashly generate (-h|--help) @@ -32,4 +34,5 @@ Options: Examples: bashly generate --force bashly generate --wrap my_function + bashly build --watch --env production bashly g -uw diff --git a/spec/bashly/commands/generate_spec.rb b/spec/bashly/commands/generate_spec.rb index cf259e68..d1ba9c5b 100644 --- a/spec/bashly/commands/generate_spec.rb +++ b/spec/bashly/commands/generate_spec.rb @@ -11,6 +11,12 @@ end end + describe 'build --help' do + it 'is an alias to generate' do + expect { subject.execute %w[build --help] }.to output_approval('cli/generate/help') + end + end + describe 'generate' do let(:cli_script) { "#{target_dir}/cli" }