carvel-dev / carvel-dev/vendir

Bash completion error

Open
#275 1 comment 0 reactions 0 assignees View on GitHub
bug carvel-accepted hacktoberfest priority/important-longterm
Dominant language
Go
Stars
399
Forks
73
Avg merge
2h 53m
Merged PRs (30d)
2

Description

**What steps did you take:**

```bash
source <(vendir completion bash)
```

**What happened:**

```bash
source <(vendir completion bash)
bash: Succeeded: command not found
echo $?
127
```

**What did you expect:**

```bash
source <(vendir completion bash)
echo $?
0
```

**Anything else you would like to add:**

A minor issue for the team is when loading bash completion, the word "Succeeded" is printed to stdout as per [here](https://github.com/carvel-dev/vendir/blob/bc7a968800ebec21b2dd0d3782e359fdbed0e0ca/cmd/vendir/vendir.go#L37).

When sourced as shown above, this causes bash to try and run `Succeeded` as a command resulting in

```bash
bash: Succeeded: command not found
```

A workaround is as follows but would be nice to be the same as other carvel tools.

```bash
source <(vendir completion bash | grep -v "Succeeded")
```

**Environment:**

- Debian Linux

```bash
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
```

- vendir version `v0.34.3`

---
Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

Contributor guide

Open the contributing guide

Research direction

Start at cmd/vendir/vendir.go line 37 and inspect the output produced by `vendir completion bash`. Run `source <(vendir completion bash)` before and after the change, confirming that no `Succeeded` text is emitted and the command exits with status 0.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, go
Domain
cli, developer-experience
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.