Class: Resumer::CLI
- Inherits:
-
Object
- Object
- Resumer::CLI
- Includes:
- Commander::Methods
- Defined in:
- lib/resumer.rb
Overview
Commander CLI interface
Instance Method Summary collapse
-
#add_export_command ⇒ Object
rubocop:disable Metrics/MethodLength.
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
-
#run ⇒ Object
rubocop:enable Metrics/MethodLength.
Constructor Details
Instance Method Details
#add_export_command ⇒ Object
rubocop:disable Metrics/MethodLength
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/resumer.rb', line 24 def add_export_command command :export do |c| c.option '-c', '--config FILE', 'Load a custom configuration file' c.option '--format STRING', 'Destination format (HTML or PDF)' c.summary = 'Export a YAML resume to HTML or PDF format' c.syntax = "#{Resumer::BIN} export <source.yml> [destination.html|.pdf]" c.action do |args, | Resumer::Command::Export.new(args, ).run rescue StandardError => e say "Error (#{e.class.name}): #{e.}" exit 1 end end end |