Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] bash complete issues #301

Closed
a1994sc opened this issue Aug 21, 2024 · 2 comments · Fixed by #304
Closed

[BUG] bash complete issues #301

a1994sc opened this issue Aug 21, 2024 · 2 comments · Fixed by #304
Labels
bug Something isn't working size/S Denotes an issue/PR requiring a relatively small amount of work
Milestone

Comments

@a1994sc
Copy link
Contributor

a1994sc commented Aug 21, 2024

Environmental Info:

  • Linux hostname 6.10.5-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 14 15:49:44 UTC 2024 x86_64 GNU/Linux

Hauler Version:

  • 1.0.7

Describe the Bug:

  • The shell auto-complete seems to be broken, it generates auto-complete for the program bash / zsh / fish, not hauler

Steps to Reproduce:

  1. docker pull ghcr.io/hauler-dev/hauler:v1.0.7
  2. docker run ghcr.io/hauler-dev/hauler:v1.0.7 completion bash

Expected Behavior:

  • It should have an output like the following at the bottom
if [[ $(type -t compopt) = "builtin" ]]; then
    complete -o default -F __start_hauler hauler
else
    complete -o default -o nospace -F __start_hauler hauler
fi

Actual Behavior:

  • It has the following
if [[ $(type -t compopt) = "builtin" ]]; then
    complete -o default -F __start_bash bash
else
    complete -o default -o nospace -F __start_bash bash
fi

Additional Context:

I was able to make things work but applying the following patch

diff --git a/cmd/hauler/cli/completion.go b/cmd/hauler/cli/completion.go
index e42bf20..8d50263 100644
--- a/cmd/hauler/cli/completion.go
+++ b/cmd/hauler/cli/completion.go
@@ -9,7 +9,7 @@ import (

 func addCompletion(parent *cobra.Command) {
 	cmd := &cobra.Command{
-		Use:   "completion",
+		Use:   "hauler completion",
 		Short: "Generates completion scripts for various shells",
 		Long:  `The completion sub-command generates completion scripts for various shells.`,
 	}

I will submit a PR later today with that change.

@a1994sc a1994sc added the bug Something isn't working label Aug 21, 2024
@github-project-automation github-project-automation bot moved this to Pending Review in Hauler Aug 21, 2024
@zackbradys
Copy link
Member

Hey @a1994sc, thanks for submitting the issue and catching this. Looking forward to taking a look at the PR!

@zackbradys zackbradys moved this from Pending Review to Work In Progress in Hauler Aug 22, 2024
@zackbradys zackbradys added this to the Hauler v1.1.0 milestone Aug 22, 2024
@zackbradys zackbradys added the size/S Denotes an issue/PR requiring a relatively small amount of work label Aug 22, 2024
@a1994sc
Copy link
Contributor Author

a1994sc commented Aug 22, 2024

@zackbradys Submitted a PR!

@zackbradys zackbradys linked a pull request Aug 23, 2024 that will close this issue
3 tasks
@github-project-automation github-project-automation bot moved this from Work In Progress to Resolved in Hauler Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/S Denotes an issue/PR requiring a relatively small amount of work
Projects
Status: Resolved
Development

Successfully merging a pull request may close this issue.

2 participants