require 'rubygems' require 'chronic' require 'sequel' require 'Getopt/Declare' # connect to database. This will create one if it doesn't exist DB_NAME = defined?(TEST_MODE) ? nil : "#{ENV['HOME']}/.timetrap.db" DB = Sequel.sqlite DB_NAME module Timetrap extend self module CLI attr_accessor :args extend self USAGE = <<-EOF Timetrap - Simple Time Tracking Usage: #{File.basename $0} COMMAND [OPTIONS] [ARGS...] where COMMAND is one of: * alter - alter the description of the active period usage: t alter [--id ID] [--start TIME] [--end TIME] [NOTES] -i, --id Alter entry with id instead of the running entry -s, --start Change the start time to