Skip to content

Allow multiple options for exclude. #315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/t/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ def favorite(status_id, *status_ids)
def favorites(user = nil)
count = options['number'] || DEFAULT_NUM_RESULTS
opts = {}
opts[:exclude_replies] = true if options['exclude'] == 'replies'
opts[:exclude_replies] = true if options['exclude'].include? 'replies'
opts[:include_entities] = !!options['decode_uris']
opts[:include_rts] = false if options['exclude'] == 'retweets'
opts[:include_rts] = false if options['exclude'].include? 'retweets'
opts[:max_id] = options['max_id'] if options['max_id']
opts[:since_id] = options['since_id'] if options['since_id']
if user
Expand Down Expand Up @@ -747,7 +747,7 @@ def status(status_id) # rubocop:disable CyclomaticComplexity
desc 'timeline [USER]', "Returns the #{DEFAULT_NUM_RESULTS} most recent Tweets posted by a user."
method_option 'csv', aliases: '-c', type: :boolean, desc: 'Output in CSV format.'
method_option 'decode_uris', aliases: '-d', type: :boolean, desc: 'Decodes t.co URLs into their original form.'
method_option 'exclude', aliases: '-e', type: :string, enum: %w(replies retweets), desc: 'Exclude certain types of Tweets from the results.', banner: 'TYPE'
method_option 'exclude', aliases: '-e', type: :array, enum: %w(replies retweets), desc: 'Exclude certain types of Tweets from the results.', banner: 'TYPE'
method_option 'id', aliases: '-i', type: :boolean, desc: 'Specify user via ID instead of screen name.'
method_option 'long', aliases: '-l', type: :boolean, desc: 'Output in long format.'
method_option 'max_id', aliases: '-m', type: :numeric, desc: 'Returns only the results with an ID less than the specified ID.'
Expand All @@ -758,9 +758,9 @@ def status(status_id) # rubocop:disable CyclomaticComplexity
def timeline(user = nil)
count = options['number'] || DEFAULT_NUM_RESULTS
opts = {}
opts[:exclude_replies] = true if options['exclude'] == 'replies'
opts[:exclude_replies] = true if options['exclude'].include? 'replies'
opts[:include_entities] = !!options['decode_uris']
opts[:include_rts] = false if options['exclude'] == 'retweets'
opts[:include_rts] = false if options['exclude'].include? 'retweets'
opts[:max_id] = options['max_id'] if options['max_id']
opts[:since_id] = options['since_id'] if options['since_id']
if user
Expand Down