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

Add completion command #628

Merged
merged 1 commit into from
Feb 10, 2022
Merged

Add completion command #628

merged 1 commit into from
Feb 10, 2022

Conversation

ooraini
Copy link
Contributor

@ooraini ooraini commented Feb 8, 2022

Fixes #622

Description

Add shell completion command. #622

I removed the -o nospace from autocomplete/bash_autocomplete. I think it's far better.

@CLAassistant
Copy link

CLAassistant commented Feb 8, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the needs triage Waiting for discussion / prioritization by team label Feb 8, 2022
@dopey dopey self-requested a review February 9, 2022 19:38
command.Register(cmd)
}

var bash = `# bash completion for step
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we read these values from the ./autocomplete/xxx files? Otherwise we'll have to keep these updated in two places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There two options here:

  1. Phase out the files in autocomplete and change all installation scripts to use the command instead.
  2. Symlink the files inside the package and use something like embed to access them.

I'm leaning towards option 1. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I do like option 1 but I wonder if that will break other people's automation. I really don't know how people are installing step but if they expect those files to be present (as we do in our debian files and our Makefile) then they'll run into issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could keep them for a while and transition everything towards the command, and at some point later remove them. The completion scripts are very unlikely to change, so we wouldn't worry about them diverging.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like that idea.

The places that I think we need to update:

  • .goreleaser.yml
  • debian/step-cli.bash-completion
  • make/bundle.sh

Copy link
Contributor

Choose a reason for hiding this comment

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

We can add a README in the autocomplete dir that says those files are deprecated and the source of truth in the future will be step completion <shell>.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Should I do them in this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Please, if you wouldn't mind. I know they're not "directly related" to your initial issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's ready now. @dopey

Copy link
Contributor

@dopey dopey left a comment

Choose a reason for hiding this comment

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

see comments

@dopey
Copy link
Contributor

dopey commented Feb 9, 2022

Trying out the debian build in a tagged release candidate. Assuming that works, will merge.

@dopey dopey merged commit b17f29c into smallstep:master Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

step completion sub-command
3 participants