Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Provide autocompletion in bash and zsh #117

Merged
merged 2 commits into from
Feb 7, 2019

Conversation

josacar
Copy link
Contributor

@josacar josacar commented Feb 4, 2019

Closes #116

@josacar
Copy link
Contributor Author

josacar commented Feb 4, 2019

I'm quite a newbie in Golang, pls gimme some feedback :)

@nickatsegment
Copy link
Contributor

I love this! Had been meaning to add this myself, but never got around to it. Will review today.

@nickatsegment nickatsegment self-requested a review February 4, 2019 18:51
cmd/exec.go Outdated Show resolved Hide resolved
cmd/autocompletion.go Show resolved Hide resolved
completion of aws-okta commands.

Bash
$ source <(aws-okta completion bash)
Copy link
Contributor

@nickatsegment nickatsegment Feb 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if instead of subcommands, we could do a parameter defaulting to auto (the current shell).

  • bash -c 'aws-okta completion' --> bash
  • bash -c aws-okta completion bash'` --> bash
  • zsh -c 'aws-okta completion' --> zsh

Seems a little bit nicer, but not at all a blocker.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how you can check this, any suggestion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking of just parsing $SHELL. I think that's pretty standard.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$SHELL doesn't work if you change between shells, only for login shell. Maybe we can iterate it in another pr

cmd/autocompletion.go Outdated Show resolved Hide resolved
Copy link
Contributor

@nickatsegment nickatsegment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to figure out the auto thing, go ahead. Otherwise, feel free to merge!

@josacar
Copy link
Contributor Author

josacar commented Feb 7, 2019

@nickatsegment I don't have write access so I cannot merge :) Feel free to do it if you feel so.

Thanks for maintaining this project

@nickatsegment nickatsegment merged commit cb068e5 into segmentio:master Feb 7, 2019
@josacar josacar deleted the add-autocompletion branch February 8, 2019 10:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants