-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Autocomplete for exec and long flags #80
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tristanmorgan
force-pushed
the
exec-complete
branch
from
June 24, 2021 05:26
db6ac68
to
317eca9
Compare
tristanmorgan
commented
Jun 24, 2021
Comment on lines
+540
to
+549
# add warning about old keys | ||
def age_check_and_get(account:, no_token:) | ||
cred = Awskeyring.get_valid_creds(account: account, no_token: no_token) | ||
|
||
maxage = Awskeyring.key_age | ||
age = (Time.new - cred[:updated]).div Awskeyring::Awsapi::ONE_DAY | ||
warn I18n.t('message.age_check', account: account, age: age) unless age < maxage | ||
|
||
cred | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved down from above.
tristanmorgan
commented
Jun 24, 2021
Comment on lines
+452
to
459
# when a double dash is parsed it is dropped from the args but we need it | ||
def fix_args(curr, prev) | ||
if prev.nil? | ||
[ARGV[1], ARGV[2]] | ||
else | ||
[curr, prev] | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 line not covered by tests, sorry. but ARGV stubbing is tricky.
tristanmorgan
force-pushed
the
exec-complete
branch
from
June 25, 2021 00:03
317eca9
to
138fd33
Compare
shamk23
approved these changes
Jun 25, 2021
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes a regression where flags on the exec-command were not getting completions. Also adds a workaround for autocomplete not working when a double dash is the start of a long flag ("--" tab...) by pulling from the raw ARGV variable.
Did you run the Tests?