module Formatron::Completion

command completion utilities

Public Class Methods

script(command, subcommands) click to toggle source
# File lib/formatron/completion.rb, line 14
def self.script(command, subcommands)
  template = File.join(
    File.dirname(File.expand_path(__FILE__)),
    'completion',
    'completion.sh.erb'
  )
  erb = ERB.new File.read(template)
  erb.filename = template
  erb_template = erb.def_class Template, 'render()'
  erb_template.new(command, subcommands).render
end