Skip to content

Commit

Permalink
Complete flags for --version command
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmorgan committed Jul 4, 2021
1 parent f515b80 commit b736f90
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/awskeyring/awsapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def self.get_login_url(key:, secret:, token:, path:, user:)
# Get the signin token param
private_class_method def self.token_param(session_json:)
get_signin_token_url = AWS_SIGNIN_URL + '?Action=getSigninToken' \
'&Session=' + CGI.escape(session_json)
'&Session=' + CGI.escape(session_json)

uri = URI(get_signin_token_url)
request = Net::HTTP.new(uri.host, uri.port)
Expand Down
4 changes: 2 additions & 2 deletions lib/awskeyring_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
I18n.load_path = Dir.glob(File.join(File.realpath(__dir__), '..', 'i18n', '*.{yml,yaml}'))
I18n.backend.load_translations

map %w[--version -v] => :__version
map '-v' => :__version
map %w[--help -h] => :help
map 'adr' => :add_role
map 'assume-role' => :token
Expand Down Expand Up @@ -499,7 +499,7 @@ def sub_command(comp_lines)

return sub_cmds.first if sub_cmds.length == 1

self.class.map[sub_cmd].to_s
self.class.map[comp_lines[1]].to_s
end

# given a type return the right list for completions
Expand Down
2 changes: 1 addition & 1 deletion man/awskeyring.5
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "AWSKEYRING" "5" "June 2021" "" ""
.TH "AWSKEYRING" "5" "July 2021" "" ""
.
.SH "NAME"
\fBAwskeyring\fR \- is a small tool to manage AWS account keys in the macOS Keychain
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/awskeyring_command_more_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
expect do
described_class.start(['import', 'testaccount', '-r'])
end.to output("# Token saved for account testaccount\n"\
"# Authentication valid until #{Time.at(1_489_305_329)}\n").to_stdout
"# Authentication valid until #{Time.at(1_489_305_329)}\n").to_stdout
expect(Awskeyring::Awsapi).not_to have_received(:verify_cred)
end

Expand Down
1 change: 1 addition & 0 deletions spec/lib/awskeyring_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
['awskeyring token servian minion 123456 --dura', %w[--dura 123456], "--duration\n", 'flags'],
['awskeyring token servian minion --dura', %w[--dura minion], "--duration\n", 'flags'],
['awskeyring con servian --p', %w[--p servian], "--path\n", 'flags'],
['awskeyring -v --n', %w[--n -v], "--no-remote\n", 'flags for --version'],
['awskeyring exec servian --no', %w[--no servian], "--no-bundle\n--no-token\n", 'flags for exec'],
['awskeyring console servian --path cloud', %w[cloud --path], "cloudformation\n", 'console paths'],
['awskeyring con servian --browser Sa', %w[Sa --browser], "Safari\n", 'browsers']
Expand Down

0 comments on commit b736f90

Please sign in to comment.