Skip to content

[bash completion] _az_python_argcomplete generates empty output in Git Bash #26051

@mloskot

Description

@mloskot
  1. Paste this function to Git Bash

    azure-cli/az.completion

    Lines 1 to 20 in f6ea6fc

    _az_python_argcomplete() {
    local IFS=$'\013'
    local SUPPRESS_SPACE=0
    if compopt +o nospace 2> /dev/null; then
    SUPPRESS_SPACE=1
    fi
    COMPREPLY=( $(IFS="$IFS" \
    COMP_LINE="$COMP_LINE" \
    COMP_POINT="$COMP_POINT" \
    COMP_TYPE="$COMP_TYPE" \
    _ARGCOMPLETE_COMP_WORDBREAKS="$COMP_WORDBREAKS" \
    _ARGCOMPLETE=1 \
    _ARGCOMPLETE_SUPPRESS_SPACE=$SUPPRESS_SPACE \
    "$1" 8>&1 9>&2 1>/dev/null 2>/dev/null) )
    if [[ $? != 0 ]]; then
    unset COMPREPLY
    elif [[ $SUPPRESS_SPACE == 1 ]] && [[ "$COMPREPLY" =~ [=/:]$ ]]; then
    compopt -o nospace
    fi
    }

  2. Run _az_python_argcomplete "az"

  3. Observe empty output

In other words, for some reasons, sourcing https://github.com/Azure/azure-cli/blob/f6ea6fcc834d5e448a1e5df9257f2d47e2a05b78/az.completion into Git Bash does not configure completion for az.

$ az version
Azure-cli    Azure-cli-core    Azure-cli-telemetry
-----------  ----------------  ---------------------
2.46.0       2.46.0            1.0.8

Metadata

Metadata

Assignees

Labels

Azure CLI TeamThe command of the issue is owned by Azure CLI teamCoreCLI core infrastructureOKR CandidateThis label is used to track how many GitHub issues we have resolved for OKR purpose.customer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions