class Sutty::Cli::Command

Public Instance Methods

command(**options) click to toggle source

The external commands runner

@see www.rubydoc.info/gems/tty-command

@api public

   # File lib/sutty/cli/command.rb
27 def command(**options)
28   require 'tty-command'
29   TTY::Command.new(options)
30 end
cursor() click to toggle source

The cursor movement

@see www.rubydoc.info/gems/tty-cursor

@api public

   # File lib/sutty/cli/command.rb
37 def cursor
38   require 'tty-cursor'
39   TTY::Cursor
40 end
editor() click to toggle source

Open a file or text in the user's preferred editor

@see www.rubydoc.info/gems/tty-editor

@api public

   # File lib/sutty/cli/command.rb
47 def editor
48   require 'tty-editor'
49   TTY::Editor
50 end
exec_exist?(*args) click to toggle source

Check if executable exists

@see www.rubydoc.info/gems/tty-which

@api public

    # File lib/sutty/cli/command.rb
117 def exec_exist?(*args)
118   require 'tty-which'
119   TTY::Which.exist?(*args)
120 end
execute(*) click to toggle source

Execute this command

@api public

   # File lib/sutty/cli/command.rb
15 def execute(*)
16   raise(
17     NotImplementedError,
18     "#{self.class}##{__method__} must be implemented"
19   )
20 end
generator() click to toggle source

File manipulation utility methods

@see www.rubydoc.info/gems/tty-file

@api public

   # File lib/sutty/cli/command.rb
57 def generator
58   require 'tty-file'
59   TTY::File
60 end
pager(**options) click to toggle source

Terminal output paging

@see www.rubydoc.info/gems/tty-pager

@api public

   # File lib/sutty/cli/command.rb
67 def pager(**options)
68   require 'tty-pager'
69   TTY::Pager.new(options)
70 end
platform() click to toggle source

Terminal platform and OS properties

@see www.rubydoc.info/gems/tty-pager

@api public

   # File lib/sutty/cli/command.rb
77 def platform
78   require 'tty-platform'
79   TTY::Platform.new
80 end
prompt(**options) click to toggle source

The interactive prompt

@see www.rubydoc.info/gems/tty-prompt

@api public

   # File lib/sutty/cli/command.rb
87 def prompt(**options)
88   require 'tty-prompt'
89   TTY::Prompt.new(options)
90 end
screen() click to toggle source

Get terminal screen properties

@see www.rubydoc.info/gems/tty-screen

@api public

    # File lib/sutty/cli/command.rb
 97 def screen
 98   require 'tty-screen'
 99   TTY::Screen
100 end
which(*args) click to toggle source

The unix which utility

@see www.rubydoc.info/gems/tty-which

@api public

    # File lib/sutty/cli/command.rb
107 def which(*args)
108   require 'tty-which'
109   TTY::Which.which(*args)
110 end