diff --git a/completion/generate_completions.py b/completion/generate_completions.py index bde5af5a4..eaaaa6faa 100644 --- a/completion/generate_completions.py +++ b/completion/generate_completions.py @@ -22,7 +22,8 @@ if len(sys.argv) != 3: print('{}: wrong arguments'.format(sys.argv[0]), file=sys.stderr) - print('Usage: {} [SOURCE DIR] [COMPLETION TYPE]'.format(sys.argv[0]), file=sys.stderr) + print('Usage: {} [SOURCE DIR] [COMPLETION TYPE]'.format( + sys.argv[0]), file=sys.stderr) print() print("SOURCE DIR is path to the Toolbox Go source code") print("COMPLETION TYPE is either 'bash', 'zsh' or 'fish'") @@ -33,9 +34,11 @@ try: os.chdir(source_dir) - output = subprocess.run(['go', 'run', '.', 'completion', completion_type], check=True) + output = subprocess.run( + ['go', 'run', '.', '__completion', completion_type], check=True) except subprocess.CalledProcessError as e: - print('{}: go run returned non-zero exit status {}'.format(sys.argv[0], e.returncode), file=sys.stderr) + print('{}: go run returned non-zero exit status {}'.format( + sys.argv[0], e.returncode), file=sys.stderr) sys.exit(e.returncode) sys.exit(0) diff --git a/src/cmd/completion.go b/src/cmd/completion.go index 66c49696f..0837b4d71 100644 --- a/src/cmd/completion.go +++ b/src/cmd/completion.go @@ -10,7 +10,7 @@ import ( ) var completionCmd = &cobra.Command{ - Use: "completion [bash|zsh|fish|powershell]", + Use: "__completion [bash|zsh|fish|powershell]", Short: "Generate completion script", Long: `To load completions: