Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
derive completion scripts #3
hi @JoshMcguigan - thanks for your recent article (related to this project). I got started with it to understand bash completion and then I thought what would be cool is to be able to make a command itself also handle its own auto-completion. When using a CLI framework, our app is already aware of it's own sub-commands/commands and flags, we should be able to achieve auto-completion from the app itself. I shared some code with a specific CLI framework in Golang (spf13/cobra#867) and see what folks have to say. I imagine, you are thinking of something similar for rust ecosystem? If so, that is, if we make the program itself handle the functionality of shell completion, why do we need
Hi @amitsaha, thanks for the question. This project (at the moment) provides low level primitives for writing completion scripts. Something I am looking into is whether we can add functionality to derive completion scripts automatically if, for example, the user is using structopt or some other popular rust CLI framework. In this case, the user may not be aware of the low level primitives in this crate, but they would be getting used to provide completions. In short, this project at the moment is working on laying the groundwork to make it easier to do what you are describing.