-
Notifications
You must be signed in to change notification settings - Fork 76
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
TODO: Add auto-complete support for the Console driver. #22
Comments
Good idea! Currently we are working on a full refactoring of both the configuration and the Prey agent console layers. Those are using a modified version of operetta and commander. What library or steps do you have in mind to achieve autocompletion? |
readline.createInterface can have a completer sent as the third argument. One way using the existing (prey v0.9.2) code would be to have it use all output from the help module which starts with a tab or space. I'll send a pull request with proposed changes. |
Grab console completions from help.js Fixes prey#22
Originally coded against v0.9.2 but applied it to the conf/refactor branch for this pull request. Does not directly use operetta or commander so should work on any branch.
Can get some more of the gory details by doing:
but you can hide those in production by setting
or deleting the lines starting with PS: while you are refactoring, you might consider changing shortcuts of --debug (-D) and --driver (-d) Cheers, |
This solution uses If you change the "config" help to be like:
then doing
will have these completions:
More about the readline completer in the node docs: |
If you also want command line auto-completion of the argument list in bash for Linux, you can take a look at: Not sure how compatible with operetta it is as it |
Not really sure at which point this was merged but it's already on master. Thanks @josher19! |
I can help with the auto-complete. I've landed commits to improve the completer docs for Node and the REPL for LiveScript (a nice fork of CoffeeScript).
Are you just looking for auto-completing most of the commands listed under "help" when running
So, for example,
would expand to
and
would expand to
and so on.
The text was updated successfully, but these errors were encountered: