Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.

Commit

Permalink
[🔧] Modify default displayed CLI task outside app directory (#26)
Browse files Browse the repository at this point in the history
* Only show 'init' task if not in Eucalypt app directory

* Add second CLI image to README.md
  • Loading branch information
eonu authored Mar 11, 2019
1 parent c81469f commit 9dd7d8c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ $ gem install eucalypt

## Usage

Running the top-level `eucalypt` command displays information about initializing a new application:

<p align="center"><img width="70%" src="gfx/cli-1.png"></p>

Initialize a new application with:

```bash
Expand All @@ -32,7 +36,7 @@ $ eucalypt init my-new-app

Move into your new application's directory and run the top-level `eucalypt` command to display a list of all available commands:

<p align="center"><img width="70%" src="gfx/cli.png"></p>
<p align="center"><img width="70%" src="gfx/cli-2.png"></p>

## Documentation

Expand Down
Binary file added gfx/cli-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
10 changes: 8 additions & 2 deletions lib/eucalypt/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def help(shell, subcommand = false)
cmd = l.first
(/.*help.*/.match?(cmd) && /^(?!.*(helper))/.match?(cmd)) || cmd.include?('-H')
end
list.reject! {|l| /^(?!.*(init))/.match? l.first} if !Eucalypt.app? Dir.pwd

list.map {|l| l.last.sub!(?#, '·'.colorize(:pale_blue, :bold)+'›')}

if defined?(@package_name) && @package_name
Expand All @@ -32,8 +34,12 @@ def help(shell, subcommand = false)
shell.say
class_options_help(shell)

shell.say "For more information about a specific command, use #{"eucalypt -H".colorize(:pale_blue)}."
shell.say "Example: eucalypt -H generate scaffold".colorize(:grey)
if !Eucalypt.app? Dir.pwd
shell.say "For more information about creating an application, use #{"eucalypt -H init".colorize(:pale_blue)}."
else
shell.say "For more information about a specific command, use #{"eucalypt -H".colorize(:pale_blue)}."
shell.say "Example: eucalypt -H generate scaffold".colorize(:grey)
end
end
end
end

0 comments on commit 9dd7d8c

Please sign in to comment.