Bash/ZSH completion

Issue #123 resolved
SzV
created an issue

Do you plan to add completion feature?

Comments (11)

  1. SzV 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. For start name <TAB> a list of stopped services.

  2. Tildeslash 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

  3. Tildeslash repo owner

    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>>

  4. Tildeslash 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

  5. Log in to comment