Skip to content

Commit 1593939

Browse files
committed
Sanitizes aliases
1 parent 6dea5e3 commit 1593939

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

exe/lc.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
11
#!/usr/bin/env bash
2-
exec linear-cli issue list "$@"
2+
if [ "$#" -eq 0 ]; then
3+
printf "No subcommand provided, defaulting to 'lc issue list'\nlc --help to see subcommands\n" >&2
4+
exec linear-cli issue list
5+
fi
6+
if [[ "$*" =~ --help|-h ]]
7+
then
8+
printf "Each subcommand has its own help, use 'lc <subcommand> --help' to see it\n" >&2
9+
linear-cli "$@" 2>&1|sed 's/linear-cli/lc/g'
10+
exit 0
11+
fi
12+
exec linear-cli "$@"

lib/linear/cli.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ def self.register_subcommands!(command, name, klass)
3737
end
3838
end
3939

40-
def self.load_and_register!(command, description: nil)
41-
description ||= command::DESCRIPTION
42-
logger.debug "Registering #{command} #{description}"
40+
def self.load_and_register!(command)
4341
name = command.name.split('::').last.downcase
4442
command_aliases = command::ALIASES[name.to_sym] || []
45-
register name, description:, aliases: Array(command_aliases) do |cmd|
43+
register name, aliases: Array(command_aliases) do |cmd|
4644
register_subcommands! cmd, name, command
4745
end
4846
end

lib/linear/commands/issue/update.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class Update
1919
include Rubyists::Linear::CLI::Issue # for #gimme_da_issue! and other Issue methods
2020
desc 'Update an issue'
2121
argument :issue_ids, type: :array, required: true, desc: 'Issue IDs (i.e. ISS-1)'
22-
option :comment, type: :string, aliases: ['--message'], desc: 'Comment to add to the issue'
22+
option :comment, type: :string, aliases: ['-m'], desc: 'Comment to add to the issue'
2323
option :pr, type: :boolean, aliases: ['--pull-request'], default: false, desc: 'Create a pull request'
2424
option :close, type: :boolean, default: false, desc: 'Close the issue'
25-
option :reason, type: :string, aliases: ['--close-reason'], desc: 'Reason for closing the issue'
25+
option :reason, type: :string, aliases: ['--butwhy'], desc: 'Reason for closing the issue'
2626

2727
def call(issue_ids:, **options)
2828
logger.debug('Updating issues', issue_ids:, options:)

0 commit comments

Comments
 (0)