goot 0.1.3 → 0.1.4
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 +4 -4
- data/lib/goot.rb +1 -0
- data/lib/goot/cli.rb +15 -15
- data/lib/goot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5f445ac7fe3204ee6d80dbcc49badb52d15ecd0
|
4
|
+
data.tar.gz: 5d30bc95a6dbe39d3dabf946e17c66ea99ad2b67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e55ed0198d2efef167d59831e931db9df47b12cb8b0818b661e10e63a6cf3854e15ad417ca2074b29ffe9f6b48ee6b072b36c3480ad549aa460d9ed6770ab787
|
7
|
+
data.tar.gz: ead0745d04279b33ed7718808f2e854499e0f56632bf2c50d8ad06e9927f7248163426d88d88973b1482f96a19e30b2306c676dedab7f0919467a0cc9c16bb2d
|
data/lib/goot.rb
CHANGED
data/lib/goot/cli.rb
CHANGED
@@ -3,7 +3,7 @@ class Goot::CLI
|
|
3
3
|
parse ARGV
|
4
4
|
exit unless ARGV.include? '-i' or ARGV.include? '--interactive'
|
5
5
|
while argv = Readline.readline('> ', true)
|
6
|
-
parse
|
6
|
+
parse Shellwords.split(argv)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
@@ -15,7 +15,7 @@ class Goot::CLI
|
|
15
15
|
command 'ls' do
|
16
16
|
description 'List tasks, e.g. ls -l1'
|
17
17
|
on :l=, :list=, 'Specify a tasklist', :default => 0
|
18
|
-
run do
|
18
|
+
run do
|
19
19
|
tab = ' '
|
20
20
|
depths = {}
|
21
21
|
|
@@ -50,8 +50,8 @@ class Goot::CLI
|
|
50
50
|
command 't' do
|
51
51
|
description 'Toggle a task, e.g. t 0 -l1'
|
52
52
|
on :l=, :list=, 'Specify a tasklist', :default => 0
|
53
|
-
run do |
|
54
|
-
tasklist = API.get_tasklist(
|
53
|
+
run do |_, args|
|
54
|
+
tasklist = API.get_tasklist(get(:list).to_i)
|
55
55
|
tasks = API.get_tasks(tasklist).map(&:to_hash)
|
56
56
|
|
57
57
|
# TODO: check to make sure all args are ints
|
@@ -78,8 +78,8 @@ class Goot::CLI
|
|
78
78
|
command 'c' do
|
79
79
|
description 'Clear completed tasks'
|
80
80
|
on :l=, :list=, 'Specify a tasklist', :default => 0
|
81
|
-
run do
|
82
|
-
tasklist = API.get_tasklist(
|
81
|
+
run do
|
82
|
+
tasklist = API.get_tasklist(get(:list).to_i)
|
83
83
|
API.clear_tasks(tasklist)
|
84
84
|
end
|
85
85
|
end
|
@@ -87,8 +87,8 @@ class Goot::CLI
|
|
87
87
|
command 'd' do
|
88
88
|
description 'Delete a task'
|
89
89
|
on :l=, :list=, 'Specify a tasklist', :default => 0
|
90
|
-
run do |
|
91
|
-
tasklist = API.get_tasklist(
|
90
|
+
run do |_, args|
|
91
|
+
tasklist = API.get_tasklist(get(:list).to_i)
|
92
92
|
tasks = API.get_tasks(tasklist).map(&:to_hash)
|
93
93
|
|
94
94
|
# TODO: check to make sure all args are ints
|
@@ -103,12 +103,12 @@ class Goot::CLI
|
|
103
103
|
on :a=, :after=, 'Move task after specified index'
|
104
104
|
on :p=, :parent=, 'Make task a child of parent index'
|
105
105
|
on :l=, :list=, 'Specify a tasklist', :default => 0
|
106
|
-
run do |
|
107
|
-
tasklist = API.get_tasklist(
|
106
|
+
run do |_, args|
|
107
|
+
tasklist = API.get_tasklist(get(:list).to_i)
|
108
108
|
tasks = API.get_tasks(tasklist).map(&:to_hash)
|
109
109
|
|
110
|
-
previous = tasks[
|
111
|
-
parent = tasks[
|
110
|
+
previous = tasks[get(:after).to_i] if !get(:after).nil?
|
111
|
+
parent = tasks[get(:parent).to_i] if !get(:parent).nil?
|
112
112
|
|
113
113
|
API.move_task(tasklist, tasks[args[0].to_i], previous, parent)
|
114
114
|
end
|
@@ -120,13 +120,13 @@ class Goot::CLI
|
|
120
120
|
on :p=, :parent=, 'Make task a child of parent index'
|
121
121
|
on :l=, :list=, 'Specify a tasklist', :default => 0
|
122
122
|
run do |opts, args|
|
123
|
-
tasklist = API.get_tasklist(
|
123
|
+
tasklist = API.get_tasklist(get(:list).to_i)
|
124
124
|
tasks = API.get_tasks(tasklist).map(&:to_hash)
|
125
125
|
|
126
126
|
task = { :title => args[0] }
|
127
127
|
|
128
|
-
previous = tasks[
|
129
|
-
parent = tasks[
|
128
|
+
previous = tasks[get(:after).to_i] if !get(:after).nil?
|
129
|
+
parent = tasks[get(:parent).to_i] if !get(:parent).nil?
|
130
130
|
|
131
131
|
API.insert_task(tasklist, task, previous, parent)
|
132
132
|
end
|
data/lib/goot/version.rb
CHANGED