-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbrain-candle
More file actions
executable file
·72 lines (57 loc) · 2.36 KB
/
brain-candle
File metadata and controls
executable file
·72 lines (57 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env ruby
# frozen_string_literal: true
# brain-candle - graphical burndown timer to remind me to preemptively do certain repetetive tasks
require "colorize"
require "optimist"
$:.unshift(File.expand_path("~/bin/lib"))
require "dbrady_cli"
String.disable_colorization unless $stdout.tty?
class Application
include DbradyCli
def run
@opts = Optimist.options do
banner <<BANNER
brain-candle - graphical burndown timer bto remind me to preemptively do certain repetetive tasks
(STILL IN 100% TODO MODE. FOR NOW, CONSIDER STARTING A 3HR POM TO REMEMBER TO REFRESH SSO LOGIN)
Options:
BANNER
opt :debug, "Print extra debug info", short: :d, default: false
opt :pretend, "Print commands but do not run them", short: :p, default: false
opt :quiet, "Run with minimal output", short: :q, default: false
opt :verbose, "Run with verbose output (overrides --quiet)", short: :v, default: false
# @ignore_invalid_options = true # no error given if you call this with other options (good for passthru)
# plural types or type in [array] means multiple VALUES for this
# arg, but --arg can only appear once
# multi: true means the --arg can appear multiple times, and
# each element will be of the type indicated.
# If you specify both a plural type AND multi, you will get an
# array of arrays. See "batches" below.
#
# opt :sizes, type: :ints
# opt :names, default: [String]
# opt :file, type: :string, multi: true
# opt :batches, type: :strings, multi: true
#
# How you would call these:
# --sizes 8 9 9 # [8, 9, 9]
# --names Alice Bob Carol # ["Alice", "Bob", "Carol"]
# --file=1.txt --file=2.txt # ["1.txt", "2.txt"]
# --batches a b c --batches d e # [["a","b","c"], ["d","e"]]
# CONSTRAINTS: See https://www.manageiq.org/optimist/
#
# depends : # You may specify AT MOST one
# conflicts :cat, :dog, :rat # You may specify at most one
# either :left, :right, :center # You MUST specify EXACTLY one
end
opts[:quiet] = !opts[:verbose] if opts[:verbose_given]
dump_opts if debug?
Optimist.educate if ARGV.empty? # Remove this if your script takes no args
run!
end
# APP CODE GOES HERE
def run!
end
end
if __FILE__ == $0
Application.new.run
end