CLIFramework icon indicating copy to clipboard operation
CLIFramework copied to clipboard

Removing Commands from Completion Generator

Open paco3346 opened this issue 8 years ago • 3 comments
trafficstars

Is there a way make commands not show up in the shell completion scripts?

paco3346 avatar May 04 '17 17:05 paco3346

There is a hidden property in the command class. I think we can use that flag to update the completion generator

c9s avatar May 04 '17 17:05 c9s

I've done some poking around without much luck. I noticed the hidden property you're talking about but it's really only ever used by the aggregate() method on the CommandBase class.

In the generateCommandCompletionRecursively() method of BashGenerator I tried skipping any commands (such as what's in the dev group) but they're still autocompleting. After doing this my completion script is definitely missing commands such as compile and archive but yet they're still autocompleting.

There's nothing that happens real time for auto completion, is there? As in does the script inspect the .phar file on the fly to determine available commands?

paco3346 avatar May 04 '17 19:05 paco3346

The command name completion is done statically, expect the argument name and the option value.

arg and opt values are completed through the meta command, the script ask the meta command to get some information

paco3346 [email protected]於 2017年5月5日 週五,03:03寫道:

I've done some poking around without much luck. I noticed the hidden property you're talking about but it's really only ever used by the aggregate() method on the CommandBase class.

In the generateCommandCompletionRecursively() method of BashGenerator I tried skipping any commands (such as what's in the dev group) but they're still autocompleting. After doing this my completion script is definitely missing commands such as compile and archive but yet they're still autocompleting.

There's nothing that happens real time for auto completion, is there? As in does the script inspect the .phar file on the fly to determine available commands?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/c9s/CLIFramework/issues/102#issuecomment-299279242, or mute the thread https://github.com/notifications/unsubscribe-auth/AADGziDWH4GmpMDSg3iewEiVdVMEyqkRks5r2iEKgaJpZM4NQ9cF .

c9s avatar May 05 '17 07:05 c9s