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

Avoid using newline as a completion separator #17

Merged
merged 1 commit into from May 17, 2022

Conversation

marckhouzam
Copy link
Owner

When calling the _completionTests_complete function in a sub-shell, the trailing newlines are removed by the shell. Therefore, if the script we are testing mistakenly includes an empty completion at the end, we would not detect that bug.
See spf13/cobra#1691

With this commit, we use a space to separate the completions, so an empty one will be detected (extra space).

With this change we can see the tests failing before spf13/cobra#1691 and start to pass again when spf13/cobra#1691 is applied

/cc @scop

When calling the _completionTests_complete function in a subshell,
the trailing newlines are removed by the shell.  Therefore if the script
mistakenly includes an empty completion at the end, we would not detect
that bug.  See spf13/cobra#1691

With this commit, we use a space to separate the completions, so an
empty one will be detected (extra space).

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
@marckhouzam marckhouzam merged commit af718ac into main May 17, 2022
@marckhouzam marckhouzam deleted the feat/detectNewLine branch May 17, 2022 17:43
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.

None yet

1 participant