3 Update url
source | link

Normally to see the completion associated with a command like firewall-cmd one would use complete -p firewall-cmd and expect to see something like complete -F _firewall_cmd firewall-cmd coming back. One would then examine the _firewall_cmd function using type _firewall_cmd.

The bash completion package for Debian uses a complete -D command to set up a default completion function, which looks to see if there is a specific completion available the first time it is used, and if so loads it.

Therefore it is important to attempt completion once before looking to see how completion is set up.

For firewall-cmd this filefile defines the completion function which currently starts

_firewall_cmd()
{
    local cur prev words cword split
    _init_completion -s || return
    firewall-cmd --state 1> /dev/null || return

The /usr/bin/firewall-cmd program itself is a python script, which ends up needing root privileges and asking for authentication. A call of firewall-cmd --state returns true if the firewall is running. The intention of the completion code therefore seems to be to not do completion if the firewall isn't running. However it is written to need the privileges to see if the firewall is running, and this is causing the unwanted prompts.

Deleting the firwall-cmd --state 1> /dev/null || return line from the completion function makes completion faster, not prompt for password, and other general goodness.

Normally to see the completion associated with a command like firewall-cmd one would use complete -p firewall-cmd and expect to see something like complete -F _firewall_cmd firewall-cmd coming back. One would then examine the _firewall_cmd function using type _firewall_cmd.

The bash completion package for Debian uses a complete -D command to set up a default completion function, which looks to see if there is a specific completion available the first time it is used, and if so loads it.

Therefore it is important to attempt completion once before looking to see how completion is set up.

For firewall-cmd this file defines the completion function which currently starts

_firewall_cmd()
{
    local cur prev words cword split
    _init_completion -s || return
    firewall-cmd --state 1> /dev/null || return

The /usr/bin/firewall-cmd program itself is a python script, which ends up needing root privileges and asking for authentication. A call of firewall-cmd --state returns true if the firewall is running. The intention of the completion code therefore seems to be to not do completion if the firewall isn't running. However it is written to need the privileges to see if the firewall is running, and this is causing the unwanted prompts.

Deleting the firwall-cmd --state 1> /dev/null || return line from the completion function makes completion faster, not prompt for password, and other general goodness.

Normally to see the completion associated with a command like firewall-cmd one would use complete -p firewall-cmd and expect to see something like complete -F _firewall_cmd firewall-cmd coming back. One would then examine the _firewall_cmd function using type _firewall_cmd.

The bash completion package for Debian uses a complete -D command to set up a default completion function, which looks to see if there is a specific completion available the first time it is used, and if so loads it.

Therefore it is important to attempt completion once before looking to see how completion is set up.

For firewall-cmd this file defines the completion function which currently starts

_firewall_cmd()
{
    local cur prev words cword split
    _init_completion -s || return
    firewall-cmd --state 1> /dev/null || return

The /usr/bin/firewall-cmd program itself is a python script, which ends up needing root privileges and asking for authentication. A call of firewall-cmd --state returns true if the firewall is running. The intention of the completion code therefore seems to be to not do completion if the firewall isn't running. However it is written to need the privileges to see if the firewall is running, and this is causing the unwanted prompts.

Deleting the firwall-cmd --state 1> /dev/null || return line from the completion function makes completion faster, not prompt for password, and other general goodness.

2 added 65 characters in body
source | link

Normally to see the completion associated with a command like firewall-cmd one would use complete -p firewall-cmd and expect to see something like complete -F _firewall_cmd firewall-cmd coming back. One would then examine the _firewall_cmd function using type _firewall_cmd.

The bash completion package for Debian uses a complete -D command to set up a default completion function, which looks to see if there is a specific completion available the first time it is used, and if so loads it.

Therefore it is important to attempt completion once before looking to see how completion is set up.

For firewall-cmd this file defines the completion function which currently starts

_firewall_cmd()
{
    local cur prev words cword split
    _init_completion -s || return
    firewall-cmd --state 1> /dev/null || return

The /usr/bin/firewall-cmd program itself is a python script, which ends up calling sudoneeding root privileges and asking for authentication. A call of firewall-cmd --state returns true if the firewall is running. The intention of the completion code therefore seems to be to not do completion if the firewall isn't running. However it needsis written to run sudoneed the privileges to see if itthe firewall is running, and this is causing the unwanted prompts.

Deleting the firwall-cmd --state 1> /dev/null || return line from the completion function makes completion faster, not prompt for password, and other general goodness.

Normally to see the completion associated with a command like firewall-cmd one would use complete -p firewall-cmd and expect to see something like complete -F _firewall_cmd firewall-cmd coming back. One would then examine the _firewall_cmd function using type _firewall_cmd.

The bash completion package for Debian uses a complete -D command to set up a default completion function, which looks to see if there is a specific completion available the first time it is used, and if so loads it.

Therefore it is important to attempt completion once before looking to see how completion is set up.

For firewall-cmd this file defines the completion function which currently starts

_firewall_cmd()
{
    local cur prev words cword split
    _init_completion -s || return
    firewall-cmd --state 1> /dev/null || return

The /usr/bin/firewall-cmd program itself is a python script, which ends up calling sudo. A call of firewall-cmd --state returns true if the firewall is running. The intention of the completion code therefore seems to be to not do completion if the firewall isn't running. However it needs to run sudo to see if it is running, and this is causing the unwanted prompts.

Deleting the firwall-cmd --state 1> /dev/null || return line from the completion function makes completion faster, not prompt for password, and other general goodness.

Normally to see the completion associated with a command like firewall-cmd one would use complete -p firewall-cmd and expect to see something like complete -F _firewall_cmd firewall-cmd coming back. One would then examine the _firewall_cmd function using type _firewall_cmd.

The bash completion package for Debian uses a complete -D command to set up a default completion function, which looks to see if there is a specific completion available the first time it is used, and if so loads it.

Therefore it is important to attempt completion once before looking to see how completion is set up.

For firewall-cmd this file defines the completion function which currently starts

_firewall_cmd()
{
    local cur prev words cword split
    _init_completion -s || return
    firewall-cmd --state 1> /dev/null || return

The /usr/bin/firewall-cmd program itself is a python script, which ends up needing root privileges and asking for authentication. A call of firewall-cmd --state returns true if the firewall is running. The intention of the completion code therefore seems to be to not do completion if the firewall isn't running. However it is written to need the privileges to see if the firewall is running, and this is causing the unwanted prompts.

Deleting the firwall-cmd --state 1> /dev/null || return line from the completion function makes completion faster, not prompt for password, and other general goodness.

1
source | link

Normally to see the completion associated with a command like firewall-cmd one would use complete -p firewall-cmd and expect to see something like complete -F _firewall_cmd firewall-cmd coming back. One would then examine the _firewall_cmd function using type _firewall_cmd.

The bash completion package for Debian uses a complete -D command to set up a default completion function, which looks to see if there is a specific completion available the first time it is used, and if so loads it.

Therefore it is important to attempt completion once before looking to see how completion is set up.

For firewall-cmd this file defines the completion function which currently starts

_firewall_cmd()
{
    local cur prev words cword split
    _init_completion -s || return
    firewall-cmd --state 1> /dev/null || return

The /usr/bin/firewall-cmd program itself is a python script, which ends up calling sudo. A call of firewall-cmd --state returns true if the firewall is running. The intention of the completion code therefore seems to be to not do completion if the firewall isn't running. However it needs to run sudo to see if it is running, and this is causing the unwanted prompts.

Deleting the firwall-cmd --state 1> /dev/null || return line from the completion function makes completion faster, not prompt for password, and other general goodness.