Class: Cir::Cli::RegisterCommand

Inherits:
CommandWithRepository show all
Defined in:
lib/cir/cli/register_command.rb

Overview

Register command

Instance Attribute Summary

Attributes inherited from CommandWithRepository

#repository

Attributes inherited from Command

#args, #files, #global_args

Instance Method Summary collapse

Methods inherited from CommandWithRepository

#initialize

Methods inherited from Command

#initialize

Constructor Details

This class inherits a constructor from Cir::Cli::CommandWithRepository

Instance Method Details

#optsObject



20
21
22
23
24
25
# File 'lib/cir/cli/register_command.rb', line 20

def opts
  Trollop::Parser.new do
    banner "Start tracking new file(s)."
    opt :message, "Optional commit message that should be used when updating the changes in tracking git repository.", type: :string
  end
end

#processObject



27
28
29
30
31
# File 'lib/cir/cli/register_command.rb', line 27

def process
  Trollop::die "Missing file list" if self.files.empty?

  self.repository.register(self.files, {message: self.args.message})
end