Finished feature
This commit is contained in:
parent
91d06fa18c
commit
c6f238ae01
19
bucket-tool
19
bucket-tool
@ -37,6 +37,7 @@ Restore Flags:
|
||||
Global Flags:
|
||||
-d | --debug : Set debug flag
|
||||
-h | --help : This help message
|
||||
-b | --bucket <bucket-dir> : User specified bucket directory
|
||||
|
||||
Listing Filter Flags:
|
||||
--from-date <DATE> : Filter listings from starting after this point (FORMAT: YYYY-MM-DD HH:MM:SS)
|
||||
@ -284,6 +285,19 @@ while i < ARGV.count
|
||||
usage
|
||||
exit
|
||||
end
|
||||
|
||||
when '-b', '--bucket'
|
||||
log "user provided ARGV[i.next] == #{ARGV[i.next]}"
|
||||
if ARGV[i.next] != "" and not ARGV[i.next] =~ FLAG_REGEX
|
||||
$CONFIG[:bucketdir]=ARGV[i.next]
|
||||
log "$CONFIG[:bucketdir] was set to #{ARGV[i.next]}"
|
||||
i+=2
|
||||
else
|
||||
puts "Flag[#{ARGV[i]}] : Argument[#{ARGV[i.next]}] : Either the argument was not provided or it was a flag"
|
||||
usage
|
||||
exit
|
||||
end
|
||||
|
||||
when '--to-date', '--from-date'
|
||||
if ARGV[i.next] != "" and ARGV[i.next] =~ DATE_REGEX
|
||||
date_matches = DATE_REGEX.match(ARGV[i.next]).named_captures.each_value.select{|val| not val.nil?}.map(&:to_i)
|
||||
@ -319,6 +333,11 @@ if $CONFIG[:action] == ""
|
||||
puts "Action was not provided"
|
||||
end
|
||||
|
||||
if not Dir.exist? $CONFIG[:bucketdir]
|
||||
puts "BucketDir[#{$CONFIG[:bucketdir]}] Does not exist. Please check to make sure configuration is correct"
|
||||
exit
|
||||
end
|
||||
|
||||
case $CONFIG[:action]
|
||||
when 'search', 'get'
|
||||
if $CONFIG[:search_term] == ""
|
||||
|
Loading…
Reference in New Issue
Block a user