xuuki-do-list 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52201be4d5a2317a6eb1add43aa43dae5a4d8e0af639643f653b133e5be93162
4
- data.tar.gz: 85a6d79f5e9f2a4c8113bbc29c06352d0224b9b2c5e235d10c028625ad040669
3
+ metadata.gz: 0e88cd31b063664b3f9eef917b9da3443f6ca0f511dbf9928ac08fb075a826db
4
+ data.tar.gz: c36e56e2fb6baabee7fb856e3afad82007b113bb9627bc276a83098544e127f1
5
5
  SHA512:
6
- metadata.gz: 9b7e55f63ab771cf835fe8a60c106152e212d68bee89f52749f75fa2a7ae0f19a1e115679fd5fc98aa91a592104d70b243982aabdae9af045d72e61a04690ab8
7
- data.tar.gz: d833f02e20b9934dcee7bd085cadb4603b0eeadd8f3b368491530cddcd9eb95baf40123b1f700643aea5c4f9e259f1d5e62cab9c1a783725d2de56f3b6d20c5d
6
+ metadata.gz: a11da4bf49507df0294196b513ea084fc8e167189a975271e2d6d962a2ed538c8694f07e5f304cfdb91c00a2bbb360523041bd55b6a6997438389b510026d417
7
+ data.tar.gz: db699dc8c423914778a0746fc4cb4844f25c7f4682bca572243ffbfe3043e1122d65dab8a4c8e972ef7ba1951c391c5540928546489073753b1ca1232fd4613d
data/bin/xuuki-do-list CHANGED
@@ -69,15 +69,29 @@ class App
69
69
  desc 'List tasks'
70
70
  arg_name 'Describe arguments to list here'
71
71
  command :list do |c|
72
+ c.desc 'Format of the output'
73
+ c.arg_name 'csv|pretty'
74
+ c.default_value 'pretty'
75
+ c.flag :format
76
+
72
77
  c.action do |global_options, options, args|
78
+
73
79
  File.open(TODO_FILE,'r') do |file|
74
80
  counter = 1
81
+
75
82
  file.readlines.each do |line|
76
83
  name,created,completed = read_todo(line)
77
- printf("%3d - %s\n",counter,name)
78
- printf(" Created : %s\n",created)
79
- unless completed.nil?
80
- printf(" Completed : %s\n",completed)
84
+ status = completed.nil? || completed.empty? ? "INCOMPLETE" : "DONE"
85
+
86
+ if options[:format] == 'pretty'
87
+ # Use the pretty-print format
88
+ printf("%3d - %s\n", counter, name)
89
+ printf(" Created : %s\n", created)
90
+ printf(" Status : %s\n", status)
91
+ printf(" Completed : %s\n", completed) unless completed.nil? || completed.empty?
92
+ elsif options[:format] == 'csv'
93
+ # Use the machine-readable CSV format
94
+ printf("%d,%s,%s,%s,%s\n", counter, name, status, created,completed)
81
95
  end
82
96
  counter += 1
83
97
  end
@@ -113,10 +127,6 @@ class App
113
127
  else
114
128
  puts "No such file: #{TODO_FILE}"
115
129
  end
116
-
117
-
118
-
119
-
120
130
  end
121
131
  end
122
132
 
@@ -1,3 +1,3 @@
1
1
  module XuukiToDo
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xuuki-do-list
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Nash
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-21 00:00:00.000000000 Z
10
+ date: 2025-01-22 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rake