Skip to content

Commit 56d400b

Browse files
committed
Adds better wrapper help
1 parent 1593939 commit 56d400b

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

exe/lc.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ then
99
linear-cli "$@" 2>&1|sed 's/linear-cli/lc/g'
1010
exit 0
1111
fi
12-
exec linear-cli "$@"
12+
if ! linear-cli "$@"
13+
then
14+
printf "lc: linear-cli failed\n" >&2
15+
lc "$@" --help 2>&1
16+
exit 1
17+
fi

lib/linear/cli/caller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def self.prepended(mod) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
2424
exit 1
2525
rescue NotFoundError => e
2626
logger.error e.message
27+
exit 66
2728
rescue StandardError => e
2829
logger.error e.message
2930
logger.error e.backtrace.join("\n") if Rubyists::Linear.verbosity.positive?

lib/linear/commands/issue/update.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class Update
2525
option :reason, type: :string, aliases: ['--butwhy'], desc: 'Reason for closing the issue'
2626

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

0 commit comments

Comments
 (0)