Skip to content

Commit

Permalink
Adds better wrapper help
Browse files Browse the repository at this point in the history
  • Loading branch information
bougyman committed Feb 5, 2024
1 parent 1593939 commit 56d400b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion exe/lc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ then
linear-cli "$@" 2>&1|sed 's/linear-cli/lc/g'
exit 0
fi
exec linear-cli "$@"
if ! linear-cli "$@"
then
printf "lc: linear-cli failed\n" >&2
lc "$@" --help 2>&1
exit 1
fi
1 change: 1 addition & 0 deletions lib/linear/cli/caller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def self.prepended(mod) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
exit 1
rescue NotFoundError => e
logger.error e.message
exit 66
rescue StandardError => e
logger.error e.message
logger.error e.backtrace.join("\n") if Rubyists::Linear.verbosity.positive?
Expand Down
1 change: 1 addition & 0 deletions lib/linear/commands/issue/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Update
option :reason, type: :string, aliases: ['--butwhy'], desc: 'Reason for closing the issue'

def call(issue_ids:, **options)
prompt.error('You should provide at least one issue ID') && raise(SmellsBad) if issue_ids.empty?
logger.debug('Updating issues', issue_ids:, options:)
Rubyists::Linear::Issue.find_all(issue_ids).each do |issue|
update_issue(issue, **options)
Expand Down

0 comments on commit 56d400b

Please sign in to comment.