Class: HarvestWorklog::CLI
- Inherits:
-
Object
- Object
- HarvestWorklog::CLI
- Defined in:
- lib/harvest_worklog.rb
Class Method Summary collapse
Class Method Details
.run(arguments, output: $stdout, error: $stderr, client: nil) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/harvest_worklog.rb', line 30 def self.run(arguments, output: $stdout, error: $stderr, client: nil) command, *command_arguments = arguments case command when "time-off" TimeOffCLI.run(command_arguments, output:, error:, client:) when "work-entry" WorkEntryCLI.run(command_arguments, output:, error:, client:) when "aggregate" AggregateCLI.run(command_arguments, output:, error:, client:) when "-h", "--help" output.puts usage 0 else error.puts "Error: choose time-off, work-entry, or aggregate" error.puts usage 1 end end |
.usage ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/harvest_worklog.rb', line 49 def self.usage <<~USAGE Usage: harvest-worklog time-off FROM TO --project NAME --task NAME [options] harvest-worklog work-entry DATE --project NAME --task NAME --hours HOURS --notes NOTES [options] harvest-worklog aggregate FROM TO [--project NAME] [--task NAME] Commands: time-off Create one entry per local business day in a date range. work-entry Create one reviewed ordinary-work entry. aggregate Read time-entry totals without writing Harvest records. USAGE end |