Class: Memo::Cli
- Inherits:
-
Object
- Object
- Memo::Cli
- Defined in:
- lib/memo/cli/cli.rb,
lib/memo/cli/error/error.rb,
lib/memo/cli/command/edit.rb,
lib/memo/cli/command/help.rb,
lib/memo/cli/command/list.rb,
lib/memo/cli/command/fuzzy.rb,
lib/memo/cli/command/setup.rb,
lib/memo/cli/command/today.rb,
lib/memo/cli/command/config.rb,
lib/memo/cli/command/custom.rb,
lib/memo/cli/command/preview.rb
Defined Under Namespace
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(input, os: Memo::OS.new) ⇒ Cli
constructor
A new instance of Cli.
Constructor Details
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/memo/cli/cli.rb', line 12 def call cmd = case @command when "edit", "e", nil Command::Edit when "preview", "p" Command::Preview when "today", "t" Command::Today when "list", "l" Command::List when "config", "c" Command::Config when "help", "h" Command::Help when "setup", "s" Command::Setup when "fuzzy", "f" Command::Fuzzy else @options = @command Command::Custom end cmd.new(@options, os: @os).() end |