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

[Bash Completion] Generated bash completion code doesn't work for paths with spaces #1546

Closed
rednoah opened this issue Jan 8, 2022 · 2 comments
Labels
Milestone

Comments

@rednoah
Copy link

rednoah commented Jan 8, 2022

Here's my picocli Java code:

	@Option(names = "--output", description = "Output path")
	public File output;

Here's the generated bash completion code:

    --output)
      compopt -o filenames
      COMPREPLY=( $( compgen -f -- "${curr_word}" ) ) # files
      return $?
      ;;

The solution is to add local IFS=$'\n' before each compgen -f -- "${curr_word}":
filebot/plugins@2e47516

I see that in the demo already in the repository here, but the latest 4.6.2 doesn't seem to generate it like that for me, and I couldn't see any recent change notes for that:

@remkop
Copy link
Owner

remkop commented Jan 8, 2022

Hi @rednoah , this has been fixed in #1458 and #1473 but has not been released yet.

@remkop remkop added this to the 4.6.3 milestone Jan 8, 2022
@remkop remkop added the status: duplicate 👨🏻‍🤝‍👨🏻 A duplicate of another issue label Jan 8, 2022
@remkop
Copy link
Owner

remkop commented Jan 8, 2022

Closing as duplicate. This will be fixed in the next release.

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

No branches or pull requests

2 participants