Skip to content

Commit

Permalink
Add command line option support
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncodes committed Mar 27, 2017
1 parent 0045edf commit 1050125
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions bin/toggl
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
#!/usr/bin/env ruby

require 'optparse'
require 'httparty'

options = {
}

option_parser = OptionParser.new do |opts|
opts.banner = "Usage: #{File.basename $0} [options]"
end

begin
option_parser.parse!
rescue OptionParser::InvalidArgument, OptionParser::MissingArgument
$stderr.puts $!.to_s
abort option_parser.help
end

if ARGV.size > 0
abort option_parser.help
end

auth = {username: File.read(File.expand_path('~/.toggl')).chomp, password: 'api_token'}

start_date = Date.today - 14
Expand Down

0 comments on commit 1050125

Please sign in to comment.