Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predictions don't honor -S or --sso flag #382

Closed
synfinatic opened this issue May 8, 2022 · 1 comment · Fixed by #389
Closed

Predictions don't honor -S or --sso flag #382

synfinatic opened this issue May 8, 2022 · 1 comment · Fixed by #389
Labels
bug Something isn't working
Milestone

Comments

@synfinatic
Copy link
Owner

really need to get this to work IMHO

@synfinatic synfinatic added the bug Something isn't working label May 8, 2022
@synfinatic synfinatic added this to the 1.9.1 milestone May 8, 2022
@synfinatic
Copy link
Owner Author

So, this isn't possible directly because bash strips all arguments but the final one when using complete so it's not available in os.Args. So we have to use the $AWS_SSO env var or do some fancy bash function to add it back.

Something like this for a Dev and Prod SSO Instance:

func __complete-Dev-aws-sso() {
    aws-sso -S Dev $@
}

func __complete-Prod-aws-sso() {
    aws-sso -S Prod $@
}

# not sure if we can use `com
complete -F __complete-Prod-aws-sso Prod-aws-sso
complete -F __complete-Dev-aws-sso Dev-aws-sso

synfinatic added a commit that referenced this issue May 8, 2022
Bash completion doesn't normally pass anything but the final word/flag
to the binary to perform completion on, so we need to use an alias
function to handle it

Refs: #382
@synfinatic synfinatic modified the milestones: 1.9.1, 1.9.2 May 9, 2022
synfinatic added a commit that referenced this issue May 10, 2022
This change now looks at all the flags on the command line and uses
previous flags to filter results for the current flag.  We now
honor:

 * -S/--sso
 * -R/--role
 * -A/--account

Which impacts the --role, --account, --profile and --arn flags.

Replace --profile-prefix with --prefix which can now filter on
any field, not just the Profile.

Refactor our code and move all predction code into internal/predictor

Fixes: #382
synfinatic added a commit that referenced this issue May 10, 2022
This change now looks at all the flags on the command line and uses
previous flags to filter results for the current flag.  We now
honor:

 * -S/--sso
 * -R/--role
 * -A/--account

Which impacts the --role, --account, --profile and --arn flags.

Replace --profile-prefix with --prefix which can now filter on
any field, not just the Profile.

Refactor our code and move all predction code into internal/predictor

Fixes: #382
synfinatic added a commit that referenced this issue May 10, 2022
This change now looks at all the flags on the command line and uses
previous flags to filter results for the current flag.  We now
honor:

 * -S/--sso
 * -R/--role
 * -A/--account

Which impacts the --role, --account, --profile and --arn flags.

Replace --profile-prefix with --prefix which can now filter on
any field, not just the Profile.

Refactor our code and move all predction code into internal/predictor

Fixes: #382
synfinatic added a commit that referenced this issue May 10, 2022
This change now looks at all the flags on the command line and uses
previous flags to filter results for the current flag.  We now
honor:

 * -S/--sso
 * -R/--role
 * -A/--account

Which impacts the --role, --account, --profile and --arn flags.

Replace --profile-prefix with --prefix which can now filter on
any field, not just the Profile.

Refactor our code and move all predction code into internal/predictor

Fixes: #382
synfinatic added a commit that referenced this issue May 10, 2022
This change now looks at all the flags on the command line and uses
previous flags to filter results for the current flag.  We now
honor:

 * -S/--sso
 * -R/--role
 * -A/--account

Which impacts the --role, --account, --profile and --arn flags.

Replace --profile-prefix with --prefix which can now filter on
any field, not just the Profile.

Refactor our code and move all predction code into internal/predictor

Fixes: #382
synfinatic added a commit that referenced this issue May 10, 2022
This change now looks at all the flags on the command line and uses
previous flags to filter results for the current flag.  We now
honor:

 * -S/--sso
 * -R/--role
 * -A/--account

Which impacts the --role, --account, --profile and --arn flags.

Refactor our code and move all predction code into internal/predictor

Fixes: #382
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant