Sha256: 5604cf0ac92026c10a94e528d9c78b5bee6a82730e69e1edef31122a36533e63
Contents?: true
Size: 1.12 KB
Versions: 6
Compression:
Stored size: 1.12 KB
Contents
#!/usr/bin/env ruby $LOAD_PATH.unshift File.join(__dir__, '..', 'lib') require 'journal-cli' module Journal class << self def usage puts "journal v#{Journal::VERSION}" puts puts 'Usage: journal [type] [date]' puts puts 'Available journal types:' config = Journal.config puts(config['journals'].keys.map { |k| "- #{k}" }) end def run(args) if args.count.zero? puts "No journal specified" usage Process.exit 1 end case args[0] when /(-v|--version)/ puts "journal v#{Journal::VERSION}" Process.exit 0 when /(help|-h|--help)/ usage Process.exit 0 end journal = args.shift date = if args.length.positive? Chronic.parse(args.join(' '), future: false) else Time.now end if Journal.config['journals'].key?(journal) checkin = Journal::Checkin.new(journal, date) checkin.go else puts "Journal #{journal} not found" usage Process.exit 1 end end end end Journal.run(ARGV)
Version data entries
6 entries across 6 versions & 1 rubygems
Version | Path |
---|---|
journal-cli-1.0.15 | bin/journal |
journal-cli-1.0.14 | bin/journal |
journal-cli-1.0.13 | bin/journal |
journal-cli-1.0.12 | bin/journal |
journal-cli-1.0.11 | bin/journal |
journal-cli-1.0.10 | bin/journal |