Module: Formatron::CLI::Completion

Defined in:
lib/formatron/cli/completion.rb

Overview

CLI command for completion enabling script

Instance Method Summary collapse

Instance Method Details

#completion_script_action(c) ⇒ Object



7
8
9
10
11
12
# File 'lib/formatron/cli/completion.rb', line 7

def completion_script_action(c)
  c.action do |args|
    command = args[0] || 'formatron'
    print Formatron::Completion.script command, defined_commands.keys
  end
end

#completion_script_formatron_commandObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/formatron/cli/completion.rb', line 14

def completion_script_formatron_command
  command :'completion-script' do |c|
    c.syntax = 'formatron completion-script [COMMAND]'
    c.summary = 'Output a bash script to ' \
                'enable command completion'
    c.description = 'Output a bash script to ' \
                    'enable command completion'
    completion_script_action c
  end
end