commit da50ca8c7586879d1d6b2f6adbf08c913e37d8b5
parent 3e77e0ddbc34c547c4e233b6692a88f4dbad2df4
Author: Alex Balgavy <alex@balgavy.eu>
Date: Thu, 17 Dec 2020 11:16:37 +0100
pocket: check command starts_with instead of equals
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/pocket b/scripts/pocket
@@ -143,20 +143,20 @@ if ARGV[0] == 'save'
die 'save: URL required' unless ARGV[1]
pocket.save ARGV[1]
end
-elsif ARGV[0] == 'audio'
+elsif ARGV[0].start_with? 'audio'
params = { domain: '*.bandcamp.com', contentType: 'article' }.merge(get_count_sort(ARGV))
print pocket.retrieve_list(params)
-elsif ARGV[0] == 'video'
+elsif ARGV[0].start_with? 'video'
params = { contentType: 'video' }.merge(get_count_sort(ARGV))
print pocket.retrieve_list(params)
-elsif ARGV[0] == 'articles'
+elsif ARGV[0].start_with? 'article'
if ARGV[1]
params = { contentType: 'article' }.merge(get_count_sort(ARGV))
print pocket.retrieve_list(params)
else
print pocket.retrieve_list(contentType: 'article')
end
-elsif ARGV[0] == 'list'
+elsif ARGV[0].start_with? 'list'
if ARGV[1]
print pocket.retrieve_list(get_count_sort(ARGV))
else