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

gen_completion to string #566

Closed
davidszotten opened this issue Jul 4, 2016 · 2 comments · Fixed by #570
Closed

gen_completion to string #566

davidszotten opened this issue Jul 4, 2016 · 2 comments · Fixed by #570
Labels
A-completion Area: completion generator

Comments

@davidszotten
Copy link
Contributor

until there is a way to ship additional files with cargo install, i'd like to add a subcommand to my binary that prints the completion code to stdout, (that users can redirect to a file at location at their convenience; this seems more intuitive than pointing the commend at a directory and have it write there)

at the moment it seems the main entry point ComplGen is completely built around writing a file to a directory. what are your thoughts on splitting out the file writing from the generation?

given the single public api gen_completions i'm not sure what the best approach to adding/changing this would be.

@kbknapp
Copy link
Member

kbknapp commented Jul 4, 2016

Without making a breaking change, this could be possible by adding a App::gen_completion_to<W: io::Write> method. It would require some fairly minor changes to the internals of ComplGen but that shoudln't be too hard. Thanks for the idea 👍

@kbknapp kbknapp added T: new feature A-completion Area: completion generator labels Jul 4, 2016
@davidszotten
Copy link
Contributor Author

cool, will have a go

homu added a commit that referenced this issue Jul 23, 2016
add `gen_completions_to`

to write completions to buffer (e.g. stdout) instead of file. fixes #566

(for review; will fix commit message when done)

still pretty new to rust so comments on anything from style to structure would be must appreciated!
homu added a commit that referenced this issue Jul 23, 2016
add `gen_completions_to`

to write completions to buffer (e.g. stdout) instead of file. fixes #566

(for review; will fix commit message when done)

still pretty new to rust so comments on anything from style to structure would be must appreciated!
@homu homu closed this as completed in #570 Jul 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion Area: completion generator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants