Class: Toodledo::CommandLine::CompleteCommand
- Inherits:
-
BaseCommand
- Object
- CmdParse::Command
- BaseCommand
- Toodledo::CommandLine::CompleteCommand
- Defined in:
- lib/toodledo/command_line/complete_command.rb
Instance Method Summary collapse
- #execute(args) ⇒ Object
-
#initialize(client) ⇒ CompleteCommand
constructor
A new instance of CompleteCommand.
Methods inherited from BaseCommand
Constructor Details
#initialize(client) ⇒ CompleteCommand
Returns a new instance of CompleteCommand.
4 5 6 7 8 |
# File 'lib/toodledo/command_line/complete_command.rb', line 4 def initialize(client) super(client, 'complete', false) self.short_desc = "Complete a task" self.description = "Completes a task in Toodledo." end |
Instance Method Details
#execute(args) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/toodledo/command_line/complete_command.rb', line 10 def execute(args) Toodledo.begin(client.logger) do |session| line = args.join(' ') client.complete_task(session, line) end return 0 rescue ItemNotFoundError => e puts e. return -1 end |