doing 1.0.45 → 1.0.50

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -5
  3. data/bin/doing +78 -126
  4. data/lib/doing/version.rb +1 -1
  5. data/lib/doing/wwid.rb +649 -685
  6. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8449bbc0f6d6a8d059856d77abd2f4648544c3bda9e69c75a93a69fd8dffe851
4
- data.tar.gz: 90c223b97441535bd6cda1563fcbc2dd97197901b9972ceb51989b1f4ad9599c
3
+ metadata.gz: 37e84e7e125fd635921025a3c3f8a20a0987215eb551c9adf5ed4239bd276707
4
+ data.tar.gz: 6a0c28fb01d02a27c51593793d37a4600d45370d7733180cad706dddbddf8715
5
5
  SHA512:
6
- metadata.gz: a42c67cf02151718f867e98d2a6571c88a7360b2a83c5e529378730364f4b812a4811c8bc03e990b08193fc4503b6f0e3f16b572a21cac1f45d15cb562333755
7
- data.tar.gz: e0bac7d7dbd30808b9d438be3e4f887ddab05db294dff84467e55b3d3846e246e769b211dd37ff66f8e28c84c97262d23daca5af0445dd25ded03a7446707fef
6
+ metadata.gz: 975ec56664d80ceb67f9087d3bc26fa347fb5c38ec3a1488834790a8ac5e8adc2c4c6df74c64ef23eca4689bb38120f9bccce19e1a38001116548a8fdbb587d9
7
+ data.tar.gz: 8389272923846981d307dfc2f27737f478307b33f805d3eede7f476d07477037a75792f30116aee4d23e9627291546b81ddbe6a88dafba58958e135cd51d466f
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **A command line tool for remembering what you were doing and tracking what you've done.**
4
4
 
5
- _If you're one of the rare people like me who find this useful, feel free to [buy me some coffee](http://brettterpstra.com/donate)._
5
+ _If you're one of the rare people like me who find this useful, feel free to [buy me some coffee](http://brettterpstra.com/donate/)._
6
6
 
7
7
 
8
8
  ## Contents
@@ -393,10 +393,11 @@ Note that you can include a tag with synonyms in the whitelist as well to tag it
393
393
 
394
394
  #### Adding entries:
395
395
 
396
- now, did - Add an entry
397
- later - Add an item to the Later section
398
- done - Add a completed item with @done(date). No argument finishes last entry.
399
- meanwhile - Finish any @meanwhile tasks and optionally create a new one
396
+ now, did - Add an entry
397
+ later - Add an item to the Later section
398
+ done - Add a completed item with @done(date). No argument finishes last entry.
399
+ meanwhile - Finish any @meanwhile tasks and optionally create a new one
400
+ again, resume - Duplicate the last entry as new entry (without @done tag)
400
401
 
401
402
  The `doing now` command can accept `-s section_name` to send the new entry straight to a non-default section. It also accepts `--back=AMOUNT` to let you specify a start date in the past using "natural language." For example, `doing now --back=25m ENTRY` or `doing now --back="yesterday 3:30pm" ENTRY`.
402
403
 
data/bin/doing CHANGED
@@ -44,7 +44,7 @@ default_value false
44
44
  switch [:stdout], :default_value => false, :negatable => false
45
45
 
46
46
  desc 'Exclude auto tags and default tags'
47
- switch [:x,:noauto], :default_value => false
47
+ switch [:x, :noauto], :default_value => false
48
48
 
49
49
  desc 'Use a specific configuration file'
50
50
  default_value false
@@ -52,37 +52,34 @@ flag [:config_file]
52
52
 
53
53
 
54
54
  # desc 'Wrap notes at X chars (0 for no wrap)'
55
- # flag [:w,:wrapwidth], :must_match => /^\d+$/, :type => Integer
55
+ # flag [:w, :wrapwidth], :must_match => /^\d+$/, :type => Integer
56
56
 
57
57
  desc 'Specify a different doing_file'
58
58
  flag [:f, :doing_file]
59
59
 
60
60
  desc 'Add an entry'
61
61
  arg_name 'entry'
62
- command [:now,:next] do |c|
62
+ command [:now, :next] do |c|
63
63
  c.desc 'Section'
64
64
  c.arg_name 'section_name'
65
- c.default_value wwid.current_section
66
- c.flag [:s,:section], :default_value => wwid.current_section
65
+ c.flag [:s, :section], :default_value => wwid.current_section
67
66
 
68
67
  c.desc "Edit entry with #{ENV['EDITOR']}"
69
- c.switch [:e,:editor]
68
+ c.switch [:e, :editor]
70
69
 
71
70
  c.desc 'Backdate start time [4pm|20m|2h|yesterday noon]'
72
- c.flag [:back]
71
+ c.flag [:b, :back]
73
72
 
74
73
  c.desc 'Timed entry, marks last entry in section as @done'
75
- c.default_value false
76
- c.switch [:f,:finish_last], :negatable => false, :default_value => false
74
+ c.switch [:f, :finish_last], :negatable => false, :default_value => false
77
75
 
78
76
  c.desc 'Note'
79
77
  c.arg_name 'note_text'
80
- c.flag [:n,:note]
78
+ c.flag [:n, :note]
81
79
 
82
80
  # c.desc "Edit entry with specified app"
83
81
  # c.arg_name 'editor_app'
84
- # c.default_value wwid.config.has_key?('editor_app') && wwid.config['editor_app'] ? wwid.config['editor_app'] : false
85
- # c.flag [:a,:app]
82
+ # # c.flag [:a, :app]
86
83
 
87
84
  c.action do |global_options,options,args|
88
85
  if options[:back]
@@ -136,7 +133,6 @@ arg_name 'note_text'
136
133
  command :note do |c|
137
134
  c.desc 'Section'
138
135
  c.arg_name 'section_name'
139
- c.default_value wwid.current_section
140
136
  c.flag [:s, :section], :default_value => "All"
141
137
 
142
138
  c.desc "Edit entry with #{ENV['EDITOR']}"
@@ -163,7 +159,7 @@ command :note do |c|
163
159
  if input
164
160
  title, note = wwid.format_input(input)
165
161
  if note
166
- wwid.note_last(section, note, true)
162
+ wwid.note_last(section, note, replace: true)
167
163
  else
168
164
  raise "No note content"
169
165
  end
@@ -174,14 +170,14 @@ command :note do |c|
174
170
  if args.length > 0
175
171
  title, note = wwid.format_input(args.join(" "))
176
172
  note.insert(0, title)
177
- wwid.note_last(section, note, options[:r])
173
+ wwid.note_last(section, note, replace: options[:r])
178
174
  elsif STDIN.stat.size > 0
179
175
  title, note = wwid.format_input(STDIN.read)
180
176
  note.insert(0, title)
181
- wwid.note_last(section, note, options[:r])
177
+ wwid.note_last(section, note, replace: options[:r])
182
178
  else
183
179
  if options[:r]
184
- wwid.note_last(section, [], true)
180
+ wwid.note_last(section, [], replace: true)
185
181
  else
186
182
  raise "You must provide content when adding a note"
187
183
  end
@@ -196,7 +192,6 @@ arg_name 'entry'
196
192
  command :meanwhile do |c|
197
193
  c.desc 'Section'
198
194
  c.arg_name 'section_name'
199
- c.default_value wwid.current_section
200
195
  c.flag [:s, :section], :default_value => wwid.current_section
201
196
 
202
197
  c.desc "Edit entry with #{ENV['EDITOR']}"
@@ -206,7 +201,7 @@ command :meanwhile do |c|
206
201
  c.switch [:a, :archive], :default_value => false
207
202
 
208
203
  c.desc 'Backdate start date for new entry to date string [4pm|20m|2h|yesterday noon]'
209
- c.flag [:back]
204
+ c.flag [:b, :back]
210
205
 
211
206
  c.desc 'Note'
212
207
  c.arg_name 'note_text'
@@ -276,11 +271,10 @@ command :later do |c|
276
271
 
277
272
  c.desc "Edit entry with specified app"
278
273
  c.arg_name 'editor_app'
279
- c.default_value wwid.config.has_key?('editor_app') && wwid.config['editor_app'] ? wwid.config['editor_app'] : false
280
274
  c.flag [:a, :app]
281
275
 
282
276
  c.desc 'Backdate start time to date string [4pm|20m|2h|yesterday noon]'
283
- c.flag [:back]
277
+ c.flag [:b, :back]
284
278
 
285
279
  c.desc 'Note'
286
280
  c.arg_name 'note_text'
@@ -327,17 +321,14 @@ end
327
321
 
328
322
  desc 'Add a completed item with @done(date). No argument finishes last entry.'
329
323
  arg_name 'entry'
330
- command [:done,:did] do |c|
324
+ command [:done, :did] do |c|
331
325
  c.desc 'Remove @done tag'
332
- c.default_value false
333
326
  c.switch [:r, :remove], :negatable => false, :default_value => false
334
327
 
335
328
  c.desc 'Include date'
336
- c.default_value true
337
- c.switch [:d, :date], :negatable => true, :default_value => true
329
+ c.switch [:date], :negatable => true, :default_value => true
338
330
 
339
331
  c.desc 'Immediately archive the entry'
340
- c.default_value false
341
332
  c.switch [:a, :archive], :negatable => false, :default_value => false
342
333
 
343
334
  c.desc 'Set finish date to specific date/time (natural langauge parsed, e.g. --at=1:30pm). If used, ignores --back. Used with --took, backdates start date'
@@ -350,16 +341,14 @@ command [:done,:did] do |c|
350
341
  c.flag [:t, :took]
351
342
 
352
343
  c.desc 'Section'
353
- c.default_value wwid.current_section
354
- c.flag [:s,:section], :default_value => wwid.current_section
344
+ c.flag [:s, :section], :default_value => wwid.current_section
355
345
 
356
346
  c.desc "Edit entry with #{ENV['EDITOR']}"
357
- c.switch [:e,:editor]
347
+ c.switch [:e, :editor]
358
348
 
359
349
  # c.desc "Edit entry with specified app"
360
350
  # c.arg_name 'editor_app'
361
- # c.default_value wwid.config.has_key?('editor_app') && wwid.config['editor_app'] ? wwid.config['editor_app'] : false
362
- # c.flag [:a,:app]
351
+ # # c.flag [:a, :app]
363
352
 
364
353
  c.action do |global_options,options,args|
365
354
  took = 0
@@ -390,7 +379,7 @@ command [:done,:did] do |c|
390
379
  end
391
380
 
392
381
  section = wwid.guess_section(options[:s]) || options[:s].cap_first
393
- donedate = options[:d] ? "(#{finish_date.strftime('%F %R')})" : ""
382
+ donedate = options[:date] ? "(#{finish_date.strftime('%F %R')})" : ""
394
383
 
395
384
  if options[:e]
396
385
  raise "No EDITOR variable defined in environment" if ENV['EDITOR'].nil?
@@ -410,7 +399,7 @@ command [:done,:did] do |c|
410
399
  if options[:r]
411
400
  wwid.tag_last({:tags => ["done"], :count => 1, :section => section, :remove => true })
412
401
  else
413
- wwid.tag_last({:tags => ["done"], :count => 1, :section => section, :archive => options[:a], :back => finish_date, :date => options[:d]})
402
+ wwid.tag_last({:tags => ["done"], :count => 1, :section => section, :archive => options[:a], :back => finish_date, :date => options[:date]})
414
403
  end
415
404
  else
416
405
  if args.length > 0
@@ -438,26 +427,22 @@ long_desc 'Marks the last X entries with a @done tag and current date. Does not
438
427
  arg_name 'count'
439
428
  command :finish do |c|
440
429
  c.desc 'Include date'
441
- c.default_value true
442
- c.switch [:d,:date], :default_value => true
430
+ c.switch [:date], :negatable => true, :default_value => true
443
431
 
444
432
  c.desc 'Backdate completed date to date string [4pm|20m|2h|yesterday noon]'
445
- c.flag [:b,:back]
433
+ c.flag [:b, :back]
446
434
 
447
435
  c.desc 'Set the completed date to the start date plus XX[hmd]'
448
- c.flag [:t,:took]
436
+ c.flag [:t, :took]
449
437
 
450
438
  c.desc 'Auto-generate finish dates from next entry\'s start time. Automatically generate completion dates 1 minute before next start date. --auto overrides the --date and --back parameters.'
451
- c.default_value false
452
439
  c.switch [:auto], :negatable => false, :default_value => false
453
440
 
454
441
  c.desc 'Archive entries'
455
- c.default_value false
456
- c.switch [:a,:archive], :negatable => false, :default_value => false
442
+ c.switch [:a, :archive], :negatable => false, :default_value => false
457
443
 
458
444
  c.desc 'Section'
459
- c.default_value wwid.current_section
460
- c.flag [:s,:section], :default_value => wwid.current_section
445
+ c.flag [:s, :section], :default_value => wwid.current_section
461
446
 
462
447
  c.action do |global_options,options,args|
463
448
 
@@ -481,7 +466,7 @@ command :finish do |c|
481
466
  raise "Only one argument allowed"
482
467
  elsif args.length == 0 || args[0] =~ /\d+/
483
468
  count = args[0] ? args[0].to_i : 1
484
- wwid.tag_last({:tags => ["done"], :count => count, :section => section, :archive => options[:a], :sequential => options[:auto], :date => options[:d], :back => date })
469
+ wwid.tag_last({:tags => ["done"], :count => count, :section => section, :archive => options[:a], :sequential => options[:auto], :date => options[:date], :back => date })
485
470
  else
486
471
  raise "Invalid argument (specify number of recent items to mark @done)"
487
472
  end
@@ -490,13 +475,13 @@ end
490
475
 
491
476
  desc 'Repeat last entry as new entry'
492
477
  arg_name 'section'
493
- command [:again,:resume] do |c|
478
+ command [:again, :resume] do |c|
494
479
  c.desc 'Section'
495
480
  c.flag [:s, :section], :default_value => "All"
496
481
 
497
482
  c.desc 'Note'
498
483
  c.arg_name 'note_text'
499
- c.flag [:n,:note]
484
+ c.flag [:n, :note]
500
485
 
501
486
  c.action do |global_options, options, args|
502
487
  wwid.restart_last({ section: options[:s], note: options[:n] })
@@ -510,19 +495,15 @@ command :tag do |c|
510
495
  c.flag [:s, :section], :default_value => "All"
511
496
 
512
497
  c.desc 'How many recent entries to tag (0 for all)'
513
- c.default_value 1
514
498
  c.flag [:c, :count], :default_value => 1
515
499
 
516
500
  c.desc 'Include current date/time with tag'
517
- c.default_value false
518
501
  c.switch [:d, :date], :negatable => false, :default_value => false
519
502
 
520
503
  c.desc 'Remove given tag(s)'
521
- c.default_value false
522
504
  c.switch [:r, :remove], :negatable => false, :default_value => false
523
505
 
524
506
  c.desc 'Autotag entries based on autotag configuration in ~/.doingrc'
525
- c.default_value false
526
507
  c.switch [:a, :autotag], :negatable => false, :default_value => false
527
508
 
528
509
  c.action do |global_options,options,args|
@@ -557,27 +538,25 @@ command :tag do |c|
557
538
  question = "Are you sure you want to add #{tags.join(" and ")} to all records#{section_q}"
558
539
  end
559
540
 
560
- res = wwid.yn(question,false)
541
+ res = wwid.yn(question, default_response: false)
561
542
 
562
543
  unless res
563
544
  raise "Cancelled"
564
545
  end
565
546
  end
566
547
 
567
- wwid.tag_last({:tags => tags, :count => count, :section => section, :date => options[:d], :remove => options[:r], :autotag => options[:a]})
548
+ wwid.tag_last({:tags => tags, :count => count, :section => section, :date => options[:date], :remove => options[:r], :autotag => options[:a]})
568
549
  end
569
550
  end
570
551
  end
571
552
 
572
553
  desc 'Mark last entry as highlighted'
573
- command [:mark,:flag] do |c|
554
+ command [:mark, :flag] do |c|
574
555
  c.desc 'Section'
575
- c.default_value wwid.current_section
576
- c.flag [:s,:section], :default_value => wwid.current_section
556
+ c.flag [:s, :section], :default_value => wwid.current_section
577
557
 
578
558
  c.desc 'Remove mark'
579
- c.default_value false
580
- c.switch [:r,:remove], :negatable => false, :default_value => false
559
+ c.switch [:r, :remove], :negatable => false, :default_value => false
581
560
 
582
561
 
583
562
  c.action do |global_options,options,args|
@@ -591,32 +570,28 @@ long_desc 'The argument can be a section name, @tag(s) or both. "pick" or "choos
591
570
  arg_name '[section|@tags]'
592
571
  command :show do |c|
593
572
  c.desc 'Tag boolean (AND,OR,NONE)'
594
- c.default_value "OR"
595
- c.flag [:b,:bool], :default_value => "OR"
573
+ c.flag [:b, :bool], :default_value => "OR"
596
574
 
597
575
  c.desc 'Max count to show'
598
- c.default_value 0
599
- c.flag [:c,:count], :default_value => 0
576
+ c.flag [:c, :count], :default_value => 0
600
577
 
601
578
  c.desc 'Age (oldest/newest)'
602
- c.default_value 'newest'
603
- c.flag [:a,:age], :default_value => 'newest'
579
+ c.flag [:a, :age], :default_value => 'newest'
604
580
 
605
581
  c.desc 'Sort order (asc/desc)'
606
- c.default_value 'asc'
607
- c.flag [:s,:sort], :default_value => 'asc'
582
+ c.flag [:s, :sort], :default_value => 'asc'
608
583
 
609
584
  c.desc %{
610
- Date range to show, or a single day to filter date on. Date range argument should be quoted. Date specifications can be natural language. To specify a range, use "to," or "through,". Example `doing show --from "monday to friday"`
585
+ Date range to show, or a single day to filter date on.
586
+ Date range argument should be quoted. Date specifications can be natural language.
587
+ To specify a range, use "to" or "through": `doing show --from "monday to friday"`
611
588
  }
612
- c.flag [:f,:from]
589
+ c.flag [:f, :from]
613
590
 
614
591
  c.desc 'Show time intervals on @done tasks'
615
- c.default_value true
616
- c.switch [:t,:times], :default_value => true
592
+ c.switch [:t, :times], :default_value => true
617
593
 
618
594
  c.desc 'Show intervals with totals at the end of output'
619
- c.default_value false
620
595
  c.switch [:totals], :default_value => false, :negatable => true
621
596
 
622
597
  c.desc 'Sort tags by (name|time)'
@@ -627,11 +602,10 @@ command :show do |c|
627
602
  c.flag [:tag_sort], :default_value => default
628
603
 
629
604
  c.desc 'Only show items with recorded time intervals'
630
- c.default_value false
631
605
  c.switch [:only_timed], :default_value => false, :negatable => false
632
606
 
633
607
  c.desc 'Output to export format (csv|html|json)'
634
- c.flag [:o,:output]
608
+ c.flag [:o, :output]
635
609
  c.action do |global_options,options,args|
636
610
 
637
611
  tag_filter = false
@@ -696,22 +670,24 @@ command :show do |c|
696
670
  end
697
671
 
698
672
  desc 'Search for entries'
699
- long_desc 'Search all sections (or limit to a single section) for entries matching text or regular expression. Normal strings are fuzzy matched, delineate regex with /expression/'
673
+ long_desc <<-'EODESC'
674
+ Search all sections (or limit to a single section) for entries matching text or regular expression. Normal strings are fuzzy matched.
675
+
676
+ To search with regular expressions, single quote the string and surround with slashes: `doing search '/\bm.*?x\b/'`
677
+ EODESC
678
+
700
679
  arg_name 'search_pattern'
701
- command [:grep,:search] do |c|
680
+ command [:grep, :search] do |c|
702
681
  c.desc 'Section'
703
- c.default_value "all"
704
- c.flag [:s,:section], :default_value => "All"
682
+ c.flag [:s, :section], :default_value => "All"
705
683
 
706
684
  c.desc 'Output to export format (csv|html|json)'
707
- c.flag [:o,:output]
685
+ c.flag [:o, :output]
708
686
 
709
687
  c.desc 'Show time intervals on @done tasks'
710
- c.default_value true
711
- c.switch [:t,:times], :default_value => true
688
+ c.switch [:t, :times], :default_value => true
712
689
 
713
690
  c.desc 'Show intervals with totals at the end of output'
714
- c.default_value false
715
691
  c.switch [:totals], :default_value => false, :negatable => true
716
692
 
717
693
  c.desc 'Sort tags by (name|time)'
@@ -722,7 +698,6 @@ command [:grep,:search] do |c|
722
698
  c.flag [:tag_sort], :default_value => default
723
699
 
724
700
  c.desc 'Only show items with recorded time intervals'
725
- c.default_value false
726
701
  c.switch [:only_timed], :default_value => false, :negatable => false
727
702
 
728
703
  c.action do |global_options,options,args|
@@ -742,15 +717,12 @@ default_value 10
742
717
  arg_name 'count'
743
718
  command :recent do |c|
744
719
  c.desc 'Section'
745
- c.default_value "All"
746
- c.flag [:s,:section], :default_value => "All"
720
+ c.flag [:s, :section], :default_value => "All"
747
721
 
748
722
  c.desc 'Show time intervals on @done tasks'
749
- c.default_value true
750
- c.switch [:t,:times], :default_value => true
723
+ c.switch [:t, :times], :default_value => true
751
724
 
752
725
  c.desc 'Show intervals with totals at the end of output'
753
- c.default_value false
754
726
  c.switch [:totals], :default_value => false, :negatable => true
755
727
 
756
728
  c.desc 'Sort tags by (name|time)'
@@ -783,15 +755,12 @@ desc 'List entries from today'
783
755
  command :today do |c|
784
756
  c.desc 'Specify a section'
785
757
  c.arg_name 'section_name'
786
- c.default_value "All"
787
- c.flag [:s,:section], :default_value => 'All'
758
+ c.flag [:s, :section], :default_value => 'All'
788
759
 
789
760
  c.desc 'Show time intervals on @done tasks'
790
- c.default_value true
791
- c.switch [:t,:times], :default_value => true
761
+ c.switch [:t, :times], :default_value => true
792
762
 
793
763
  c.desc 'Show time totals at the end of output'
794
- c.default_value false
795
764
  c.switch [:totals], :default_value => false, :negatable => true
796
765
 
797
766
  c.desc 'Sort tags by (name|time)'
@@ -802,7 +771,7 @@ command :today do |c|
802
771
  c.flag [:tag_sort], :default_value => default
803
772
 
804
773
  c.desc 'Output to export format (csv|html|json)'
805
- c.flag [:o,:output]
774
+ c.flag [:o, :output]
806
775
 
807
776
  c.action do |global_options,options,args|
808
777
 
@@ -820,15 +789,12 @@ arg_name 'date_string'
820
789
  command :on do |c|
821
790
  c.desc 'Section'
822
791
  c.arg_name 'section_name'
823
- c.default_value 'All'
824
- c.flag [:s,:section], :default_value => 'All'
792
+ c.flag [:s, :section], :default_value => 'All'
825
793
 
826
794
  c.desc 'Show time intervals on @done tasks'
827
- c.default_value true
828
- c.switch [:t,:times], :default_value => true
795
+ c.switch [:t, :times], :default_value => true
829
796
 
830
797
  c.desc 'Show time totals at the end of output'
831
- c.default_value false
832
798
  c.switch [:totals], :default_value => false, :negatable => true
833
799
 
834
800
  c.desc 'Sort tags by (name|time)'
@@ -839,7 +805,7 @@ command :on do |c|
839
805
  c.flag [:tag_sort], :default_value => default
840
806
 
841
807
  c.desc 'Output to export format (csv|html|json)'
842
- c.flag [:o,:output]
808
+ c.flag [:o, :output]
843
809
 
844
810
  c.action do |global_options,options,args|
845
811
 
@@ -872,18 +838,15 @@ desc 'List entries from yesterday'
872
838
  command :yesterday do |c|
873
839
  c.desc 'Specify a section'
874
840
  c.arg_name 'section_name'
875
- c.default_value "All"
876
- c.flag [:s,:section], :default_value => 'All'
841
+ c.flag [:s, :section], :default_value => 'All'
877
842
 
878
843
  c.desc 'Output to export format (csv|html|json)'
879
- c.flag [:o,:output]
844
+ c.flag [:o, :output]
880
845
 
881
846
  c.desc 'Show time intervals on @done tasks'
882
- c.default_value true
883
- c.switch [:t,:times], :default_value => true
847
+ c.switch [:t, :times], :default_value => true
884
848
 
885
849
  c.desc 'Show time totals at the end of output'
886
- c.default_value false
887
850
  c.switch [:totals], :default_value => false, :negatable => true
888
851
 
889
852
  c.desc 'Sort tags by (name|time)'
@@ -903,8 +866,7 @@ end
903
866
  desc 'Show the last entry'
904
867
  command :last do |c|
905
868
  c.desc 'Specify a section'
906
- c.default_value "All"
907
- c.flag [:s,:section]
869
+ c.flag [:s, :section]
908
870
 
909
871
  c.action do |global_options,options,args|
910
872
  puts wwid.last(true,options[:s]).strip
@@ -914,8 +876,7 @@ end
914
876
  desc 'List sections'
915
877
  command :sections do |c|
916
878
  c.desc 'List in single column'
917
- c.default_value false
918
- c.switch [:c,:column], :default_value => false
879
+ c.switch [:c, :column], :default_value => false
919
880
 
920
881
  c.action do |global_options,options,args|
921
882
  joiner = options[:c] ? "\n" : "\t"
@@ -966,20 +927,18 @@ desc 'Display a user-created view'
966
927
  arg_name 'view_name'
967
928
  command :view do |c|
968
929
  c.desc 'Section (override view settings)'
969
- c.flag [:s,:section]
930
+ c.flag [:s, :section]
970
931
 
971
932
  c.desc 'Count to display (override view settings)'
972
- c.flag [:c,:count], :must_match => /^\d+$/, :type => Integer
933
+ c.flag [:c, :count], :must_match => /^\d+$/, :type => Integer
973
934
 
974
935
  c.desc 'Output to export format (csv|html|json)'
975
- c.flag [:o,:output]
936
+ c.flag [:o, :output]
976
937
 
977
938
  c.desc 'Show time intervals on @done tasks'
978
- c.default_value true
979
- c.switch [:t,:times], :default_value => true
939
+ c.switch [:t, :times], :default_value => true
980
940
 
981
941
  c.desc 'Show intervals with totals at the end of output'
982
- c.default_value false
983
942
  c.switch [:totals], :default_value => false, :negatable => true
984
943
 
985
944
  c.desc 'Sort tags by (name|time)'
@@ -990,7 +949,6 @@ command :view do |c|
990
949
  c.flag [:tag_sort], :default_value => default
991
950
 
992
951
  c.desc 'Only show items with recorded time intervals'
993
- c.default_value false
994
952
  c.switch [:only_timed], :default_value => false, :negatable => true
995
953
 
996
954
  c.action do |global_options,options,args|
@@ -1053,8 +1011,7 @@ end
1053
1011
  desc 'List available custom views'
1054
1012
  command :views do |c|
1055
1013
  c.desc 'List in single column'
1056
- c.default_value false
1057
- c.switch [:c,:column], :default_value => false
1014
+ c.switch [:c, :column], :default_value => false
1058
1015
 
1059
1016
  c.action do |global_options,options,args|
1060
1017
  joiner = options[:c] ? "\n" : "\t"
@@ -1067,16 +1024,13 @@ arg_name 'section'
1067
1024
  default_value wwid.current_section
1068
1025
  command :archive do |c|
1069
1026
  c.desc 'Count to keep (ignored if archiving by tag)'
1070
- c.default_value 5
1071
- c.flag [:k,:keep], :default_value => 5, :must_match => /^\d+$/, :type => Integer
1027
+ c.flag [:k, :keep], :default_value => 5, :must_match => /^\d+$/, :type => Integer
1072
1028
 
1073
1029
  c.desc 'Move entries to'
1074
- c.default_value "Archive"
1075
- c.flag [:t,:to], :default_value => "Archive"
1030
+ c.flag [:t, :to], :default_value => "Archive"
1076
1031
 
1077
1032
  c.desc 'Tag boolean'
1078
- c.default_value "AND"
1079
- c.flag [:b,:bool], :default_value => "AND"
1033
+ c.flag [:b, :bool], :default_value => "AND"
1080
1034
 
1081
1035
  c.action do |global_options,options,args|
1082
1036
  if args.length > 0
@@ -1144,8 +1098,7 @@ end
1144
1098
  desc 'Edit the configuration file'
1145
1099
  command :config do |c|
1146
1100
  c.desc 'Editor to use'
1147
- c.default_value ENV['EDITOR']
1148
- c.flag [:e,:editor], :default_value => nil
1101
+ c.flag [:e, :editor], :default_value => nil
1149
1102
 
1150
1103
  if `uname` =~ /Darwins/
1151
1104
  c.desc 'Application to use'
@@ -1183,8 +1136,7 @@ end
1183
1136
  desc 'Undo the last change to the doing_file'
1184
1137
  command :undo do |c|
1185
1138
  c.desc 'Specify alternate doing file'
1186
- c.default_value wwid.doing_file
1187
- c.flag [:f,:file], :default_value => wwid.doing_file
1139
+ c.flag [:f, :file], :default_value => wwid.doing_file
1188
1140
 
1189
1141
  c.action do |global_options,options,args|
1190
1142
  file = options[:f] || wwid.doing_file