Skip to content

Conversation

bocekm
Copy link
Member

@bocekm bocekm commented Jul 4, 2025

Before, running leapp-inspector --db ~/Downloads/leapp.db actors --actor and pressing Tab did not do anything. It was because the bash completion script exited silently when it concluded that the ~/Downloads/leapp.db is inaccessible.

With this fix one gets this error instead:

OSError: The ~/Downloads/leapp.db file doesn't exist. Specify
the correct path to the leapp database file.

With that the user gets a hint that they need to pass a path like /home/user/Downloads/leapp.db to get the completion working.

Assisted-by: Cursor AI with Claude Sonnet 4

Before, running `leapp-inspector --db ~/Downloads/leapp.db actors --actor` and
pressing Tab did not do anything. It was because the bash completion
script exited silently when it concluded that the ~/Downloads/leapp.db
is inaccessible.

With this fix one gets this error instead:
```
OSError: The ~/Downloads/leapp.db file doesn't exist. Specify
the correct path to the leapp database file.
```

With that the user gets a hint that they need to pass a path like
/home/user/Downloads/leapp.db to get the completion working.

Assisted-by: Cursor AI with Claude Sonnet 4
@bocekm bocekm requested a review from pirat89 July 4, 2025 19:53
for word in "${COMP_WORDS[@]}"; do
if [[ "$use_next" == "1" ]]; then
[[ -e "$word" ]] || return 1
# Check if file exists, but still return the path
Copy link
Member

@pirat89 pirat89 Sep 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually it means that function is behaving differently in comparison to the description and expactations. also you can see that script is failing on python error as it's failing on the leapp-inspector script execution. The clean solution would be just adding a log error instead.

Similarly in the other case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants