Skip to content

Commit 6dea5e3

Browse files
committed
Updates aliases to add wrapper language
1 parent a245168 commit 6dea5e3

10 files changed

Lines changed: 24 additions & 11 deletions

File tree

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
linear-cli (0.5.4)
4+
linear-cli (0.6.1)
55
base64 (~> 0.2)
66
dry-cli (~> 1.0)
77
dry-cli-completion (~> 1.0)

exe/lc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/usr/bin/env ruby
22
# frozen_string_literal: true
33

4-
require 'linear'
5-
Rubyists::Linear::L :cli
6-
Dry::CLI.new(Rubyists::Linear::CLI).call
4+
exec File.join(__dir__, 'lc.sh'), *ARGV

exe/lc.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
exec linear-cli issue list "$@"

exe/lclose.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ then
44
printf "This wrapper adds the --close option to the 'issue update' command.\n" >&2
55
printf "It is used to close one or many issues. The issues are specified by their ID/slugs.\n" >&2
66
printf "For closing multiple issues, you really want to pass --reason so you do not get prompted for each issue.\n\n" >&2
7-
exec lc issue update --help
7+
exec linear-cli issue update --help
88
fi
9-
exec lc issue update --close "$@"
9+
exec linear-cli issue update --close "$@"

exe/lcls.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env bash
2-
exec lc i ls "$@"
2+
exec linear-cli issue list "$@"

exe/lcreate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env bash
2-
exec lc issue create "$@"
2+
exec linear-cli issue create "$@"

exe/linear-cli

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
require 'linear'
5+
Rubyists::Linear::L :cli
6+
Dry::CLI.new(Rubyists::Linear::CLI).call

lib/linear/cli.rb

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

40-
def self.load_and_register!(command)
41-
logger.debug "Registering #{command}"
40+
def self.load_and_register!(command, description: nil)
41+
description ||= command::DESCRIPTION
42+
logger.debug "Registering #{command} #{description}"
4243
name = command.name.split('::').last.downcase
4344
command_aliases = command::ALIASES[name.to_sym] || []
44-
register name, aliases: Array(command_aliases) do |cmd|
45+
register name, description:, aliases: Array(command_aliases) do |cmd|
4546
register_subcommands! cmd, name, command
4647
end
4748
end

lib/linear/commands/issue.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ module CLI
1010
# should be included in any command that deals with issues
1111
module Issue
1212
include CLI::SubCommands
13+
14+
DESCRIPTION = 'Manage issues'
15+
1316
# Aliases for Issue commands
1417
ALIASES = {
1518
create: %w[c new add], # aliases for the create command
@@ -19,6 +22,7 @@ module Issue
1922
issue: %w[i issues] # aliases for the main issue command itself
2023
}.freeze
2124

25+
2226
def issue_comment(issue, comment)
2327
issue.add_comment(comment)
2428
prompt.ok("Comment added to #{issue.identifier}")

lib/linear/commands/team.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ module Team
1212
list: %w[ls l], # aliases for the list command
1313
team: %w[t teams] # aliases for the main team command itself
1414
}.freeze
15+
16+
DESCRIPTION = 'Manage teams'
1517
end
1618
end
1719
end

0 commit comments

Comments
 (0)