Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bashly.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
18 changes: 9 additions & 9 deletions lib/bashly/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion lib/bashly/commands/generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions spec/approvals/cli/generate/help
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -32,4 +34,5 @@ Options:
Examples:
bashly generate --force
bashly generate --wrap my_function
bashly build --watch --env production
bashly g -uw
6 changes: 6 additions & 0 deletions spec/bashly/commands/generate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

Expand Down
Loading