semgrep bash_completion has no nosort option, MacOS, bash shell only.
Describe the bug A clear and concise description of what the bug is.
/opt/homebrew/etc/bash_completion.d/semgrep: line 25: complete: nosort: invalid option name
To Reproduce Steps to reproduce the behavior, ideally a link to https://semgrep.dev/playground (click "share" and make public to get a shortlink):
Each time do homebrew package update has this problem, this is part of bash_completion
Expected behavior A clear and concise description of what you expected to happen.
Since nosort is not compatible on Macbook, please remove it.
Screenshots If applicable, add screenshots to help explain your problem.
What is the priority of the bug to you?
- [ ] P0: blocking your adoption of Semgrep or workflow
- [x] P1: important to fix or quite annoying
- [ ] P2: regular bug that should get fixed
each time called bash completion semgrep throw error.
Environment If not using semgrep.dev: are you running off docker, an official binary, a local build?
Homebrew
Use case What will fixing this bug enable for you?
complete has no nosort option on MBP (MacBook Pro). has a OS MBP detected and alternative _semgrep_completion_setup based on OS type
chenglim.teo@Mac:~$ cat /opt/homebrew/etc/bash_completion.d/semgrep
_semgrep_completion() {
local IFS=$'\n'
local response
response=$(env COMP_WORDS="${COMP_WORDS[*]}" COMP_CWORD=$COMP_CWORD _SEMGREP_COMPLETE=bash_complete $1)
for completion in $response; do
IFS=',' read type value <<< "$completion"
if [[ $type == 'dir' ]]; then
COMPREPLY=()
compopt -o dirnames
elif [[ $type == 'file' ]]; then
COMPREPLY=()
compopt -o default
elif [[ $type == 'plain' ]]; then
COMPREPLY+=($value)
fi
done
return 0
}
_semgrep_completion_setup() {
complete -F _semgrep_completion semgrep
}
_semgrep_completion_setup;
it is annoying the bug keep coming back with brew auto upgrade.
Seems similar to #10618. Likely requires a PR to homebrew to address