Repository navigation
Conversation
Declare the shell for the completion script, quote the expansions passed to compgen and check the length of COMPREPLY instead of its first element. Drop the unused APP variable from bin/cake. The SC2207 warnings stay: mapfile is unavailable in Bash 3.2, the macOS default.
Keep the COMPREPLY assignments, because mapfile is unavailable in Bash 3.2, the macOS default, and silence SC2207 with a comment that records the reason.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1116.
bin/bash_completion.sh# shellcheck shell=bash(SC2148)."${cur}"and"${prev}"in thecompgenandcompletion subcommandscalls (SC2086).[[ $COMPREPLY = "" ]]with[[ ${#COMPREPLY[@]} -eq 0 ]], so the whole array is checked (SC2128).bin/cakeAPPvariable (SC2034).The remaining SC2207 warnings are left as they are. ShellCheck suggests
mapfile, which is not available in Bash 3.2, the macOS default, so using it would break completion there.Tested under Bash 3.2.57 with a stub
cakecommand: commands, subcommands, options and the_filedirfallback complete as before.