myworklog 1.0.6 → 1.0.7
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/worklog_cli.rb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42d37f3cfd48fb7dd15e989b814f76f6617abb1ae2f273af94c9fba0d7e752f8
|
4
|
+
data.tar.gz: 1fd15183fb9a7f391c37414dac5bc34d65a1f8fcf0021b52c4b56286f99f63dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11608be11f9dbad29af5bd6f8210102fecac722c7bb507c4f8f361edf6c8360b3bb0dbe9730d7bc6befb4375df72c7da8ab6b4a0e784e0d0809e73b22e2abf2b
|
7
|
+
data.tar.gz: 8cccbf75521a73924aaa347871b19b3c5e9eff01ce6e962dc9928499188430669e50f576950dee644db73f35b751ed2624b2041b49472fc1d3a8d44b8215590d
|
data/lib/worklog_cli.rb
CHANGED
@@ -5,10 +5,11 @@ require_relative 'work_log_controller'
|
|
5
5
|
DATE_FORMAT = 'DD/MM/YYYY'
|
6
6
|
|
7
7
|
class WorkLogCli < Thor
|
8
|
-
desc 'add [
|
9
|
-
|
10
|
-
def add(
|
8
|
+
desc 'add [DESCRIPTION]', "Adds a new work log with today's date as default. Use -d flag to specify a different date (e.g. myworklog add -d 10/10/2010 'I worked'). Date format #{DATE_FORMAT}"
|
9
|
+
options :d => :string
|
10
|
+
def add(description)
|
11
11
|
begin
|
12
|
+
date = options[:d] ? options[:d] : 'today'
|
12
13
|
WorkLogController.new.add_work_log(date, description)
|
13
14
|
rescue ArgumentError => msg
|
14
15
|
puts msg
|
@@ -27,7 +28,7 @@ class WorkLogCli < Thor
|
|
27
28
|
print(WorkLogController.new.list_all)
|
28
29
|
end
|
29
30
|
|
30
|
-
desc 'delete [ID]', 'Deletes the work log by ID.
|
31
|
+
desc 'delete [ID]', 'Deletes the work log by ID. You can use the `list` command to retrieve the ID'
|
31
32
|
|
32
33
|
def delete(id)
|
33
34
|
begin
|