|
|
@ -16,6 +16,7 @@ limitations under the License.
|
|
|
|
package main
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
|
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
"io"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"path/filepath"
|
|
|
@ -88,12 +89,12 @@ func runCompletionBash(out io.Writer, cmd *cobra.Command) error {
|
|
|
|
# to the helm completion function to handle the case where
|
|
|
|
# to the helm completion function to handle the case where
|
|
|
|
# the user renamed the helm binary
|
|
|
|
# the user renamed the helm binary
|
|
|
|
if [[ $(type -t compopt) = "builtin" ]]; then
|
|
|
|
if [[ $(type -t compopt) = "builtin" ]]; then
|
|
|
|
complete -o default -F __start_helm ` + binary + `
|
|
|
|
complete -o default -F __start_helm %[1]s
|
|
|
|
else
|
|
|
|
else
|
|
|
|
complete -o default -o nospace -F __start_helm ` + binary + `
|
|
|
|
complete -o default -o nospace -F __start_helm %[1]s
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
`
|
|
|
|
`
|
|
|
|
out.Write([]byte(renamedBinaryHook))
|
|
|
|
fmt.Fprintf(out, renamedBinaryHook, binary)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|