Skip to content

Commit 08040bf

Browse files
committed
Fix for #39 / #40
1 parent 8522ee5 commit 08040bf

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
icalPal-3.8.2
2+
==================
3+
4+
* Fix for #40
5+
6+
icalPal-3.8.1
7+
==================
8+
9+
* Fix sorting regression bug
10+
111
icalPal-3.8.0
212
==================
313

lib/options.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ def parse_options
238238
cli[:cmd] ||= env[:cmd] if env[:cmd]
239239
cli[:cmd] ||= cf[:cmd] if cf[:cmd]
240240

241+
# Must have a command
242+
raise(OptionParser::MissingArgument, 'COMMAND is required') unless cli[:cmd]
243+
241244
# Handle command aliases
242245
cli[:cmd] = 'accounts' if cli[:cmd] == 'stores'
243246
cli[:cmd] = cli[:cmd].sub('reminders', 'tasks')
@@ -261,7 +264,6 @@ def parse_options
261264
end if cli[:cmd]
262265

263266
# Must have a valid command
264-
raise(OptionParser::MissingArgument, 'COMMAND is required') unless cli[:cmd]
265267
raise(OptionParser::InvalidArgument, "Unknown COMMAND #{cli[:cmd]}") unless (COMMANDS.any? cli[:cmd])
266268

267269
# Merge options
@@ -294,8 +296,9 @@ def parse_options
294296
opts[:props] = (opts[:iep] + opts[:aep] - opts[:eep]).uniq
295297

296298
# From, to, days
299+
opts[:days] -= 1 if opts[:days]
300+
297301
if opts[:from]
298-
opts[:to] += 1 if opts[:to]
299302
opts[:to] ||= opts[:from] + 1 if opts[:from]
300303
opts[:to] = opts[:from] + opts[:days] if opts[:days]
301304
opts[:to] = RDT.new(*opts[:to].to_a[0..2] + [ 23, 59, 59 ])

lib/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module ICalPal
22
NAME = 'icalPal'.freeze
3-
VERSION = '3.8.1'.freeze
3+
VERSION = '3.8.2'.freeze
44
end

0 commit comments

Comments
 (0)