- changed status to closed
Bash/ZSH completion
Do you plan to add completion feature?
Comments (11)
-
repo owner -
reporter I was not so clear. When I type
stop name
<TAB>
a list of services should appear. Bash/ZSH calls a special predefined option. E.g.monit completions --line="$COMP_LINE" --point="$COMP_POINT"
and substitutes the whole line for$COMP_LINE
and the position in$COMP_POINT
Then monit should output a list of running services. Forstart name
<TAB>
a list of stopped services. -
repo owner This is probably better implemented as a module in the bash completion package.
-
reporter Is there a way outside monit to differentiate running/stopped services?
-
repo owner A bash completion module could use
monit summary
to get a list of service names and their status and then expand on that list. -
reporter Thank you!
-
repo owner - edited description
- changed status to open
-
reporter This is the one I install on servers:
-
repo owner thanks Victor :) We'll try to improve the completion support - the "monit summary" which we recommended an is used in the referred script as well, requires the monit daemon to be running.
Alternative could be to use 'monit -vIt' which just parses the configuration file and dumps the configuration ... will see if we can find some better way which won't require post-processing the monit output for completion
-
repo owner - changed status to resolved
Fixed: Issue
#123: Added a bash completion script for monit command-line. The script is not installed by default, if you want to enable the bash completion for monit, copy system/bash/monit file to /etc/bash_completion.d/ directory or similar (depends on your bash installation).→ <<cset f6350aedd579>>
-
repo owner created a bash completion script ... it supports all monit commands, detects if sudo is necessary, supports service groups completion for the "-g" option
- Log in to comment
That would be really cool and useful, but this is an issue for bash completion not for Monit.