Skip to content

Basic rabbitmqctl Bash Completion

April 12, 2009

_rabbitmqctl()
{
        local cur prev opts
        COMPREPLY=()
        cur=”${COMP_WORDS[COMP_CWORD]}”
        prev=”${COMP_WORDS[COMP_CWORD-1]}”

        #
        #  The basic options we’ll complete.
        #
        opts=”stop stop_app start_app reset force_reset cluster status rotate_logs add_user delete_user change_password list_users add_vhost delete_vhost list_vhosts map_user_vhost unmap_user_vhost list_user_vhosts list_vhost_users list_queues list_exchanges list_bindings list_connections”

        #
        #  Complete the arguments to some of the basic commands.
        #
        # TBD

        COMPREPLY=($(compgen -W “${opts}” — ${cur}))
        return 0
}

complete -F _rabbitmqctl rabbitmqctl

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: