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

Qualify custom bash func name #730

Merged
merged 2 commits into from
Aug 21, 2018
Merged

Conversation

pgwhalen
Copy link
Contributor

  • fixes issue where multiple cobra apps using custom bash completion
    would have their __custom_func collide
  • support fallback to plain __custom_func to maintain compatibility

#694

I tested this with a cobra app I'm developing locally and had success. I'm not totally sure how write automated tests for it other than the changes I made.

 - fixes issue where multiple cobra apps using custom bash completion
 would have their __custom_func collide
 - support fallback to plain __custom_func to maintain compatibility

spf13#694
@CLAassistant
Copy link

CLAassistant commented Aug 20, 2018

CLA assistant check
All committers have signed the CLA.

@eparis
Copy link
Collaborator

eparis commented Aug 20, 2018

I think the best way to test would be to define a custom func and then just do a string search to see if it shows up twice in the output... (Once for the actual func def, and once for the call to it?)

Also need the CLA.

 - check for the correct number of occurrences of function name

spf13#694
@pgwhalen
Copy link
Contributor Author

Signed CLA and improved the tests.

@eparis eparis merged commit 6fd8e29 into spf13:master Aug 21, 2018
@ghost ghost mentioned this pull request Dec 19, 2018
marckhouzam added a commit to VilledeMontreal/helm that referenced this pull request Apr 29, 2019
The version of Cobra used in dev-v3 is older than the one used
for the master branch (helm v2).  Although the dev-v3 branch
was based on master and therefore had the same Cobra version
originally, it was changed a couple of times to choose Cobra
tagged versions instead.

However, the latest Cobra tagged version is older than the version
of Cobra used on the master branch.  Therefore, some of the
improvements made to Cobra and used by helm v2 are not available
to helm v3 currently.

This commit brings Cobra to its latest available commit for
helm v3.  Originally, I thought of selecting the same Cobra version
in v3 as for helm v2, but after reviewing the 5 extra commits
added to Cobra, I feel it is safe and valuable to bring them in
also.

Bringing Cobra up-to-date is essential for upcoming work being
prepared for dynamic bash-completion; there are bug fixes in
Cobra that are necessary for dynamic bash-completion to work
properly.  Specifically,
    spf13/cobra#730
which fixes
    spf13/cobra#694
is essential to avoid the risk of colliding and possibly
breaking kubectl dynamic bash-completion once helm v3 has its
own dynamic completion.

Signed-off-by: Marc Khouzam <marc.khouzam@ville.montreal.qc.ca>
This was referenced May 7, 2019
marckhouzam added a commit to VilledeMontreal/helm that referenced this pull request May 7, 2019
This commit forces ([[override]]) the version of Cobra to the
tip of master.  The latest tagged release of Cobra is one week shy
of being a year old and is missing important fixes. An override
is necessary because the Kustomize package requires a tagged
version, so a [[constraint]] is rejected by dep.

The version of Cobra used in dev-v3 is older than the one used
for the master branch (helm v2). Although the dev-v3 branch
was based on master and therefore had the same Cobra version
originally, it was changed a couple of times to choose Cobra
tagged versions instead.

However, the latest Cobra tagged version is older than the version
of Cobra used on the master branch. Therefore, some of the
improvements made to Cobra and used by helm v2 are not available
to helm v3 currently.

This commit brings Cobra to its latest available commit for
helm v3. Originally, I thought of selecting the same Cobra version
in v3 as for helm v2, but after reviewing the 5 extra commits
added to Cobra, I felt it was safe and valuable to bring them in
also.

Bringing Cobra up-to-date is essential for upcoming work being
prepared for dynamic bash-completion; there are bug fixes in
Cobra that are necessary for dynamic bash-completion to work
properly. Specifically,
   spf13/cobra#730
which fixes
   spf13/cobra#694
is essential to avoid the risk of colliding and possibly
breaking kubectl dynamic bash-completion once helm v3 has its
own dynamic completion.

Signed-off-by: Marc Khouzam <marc.khouzam@ville.montreal.qc.ca>
marckhouzam added a commit to VilledeMontreal/helm that referenced this pull request May 19, 2019
The version of Cobra used in dev-v3 is older than the one used
for the master branch (helm v2). Although the dev-v3 branch
was based on master and therefore had the same Cobra version
originally, it was changed a couple of times to choose Cobra
tagged versions instead.

However, the currently used 0.0.3 version of Cobra is older than
the version of Cobra used on the master branch. Therefore, some of the
improvements made to Cobra and used by helm v2 are not available
to helm v3 currently.

This commit brings Cobra to its latest available version of 0.0.4.

Bringing Cobra up-to-date is essential for upcoming work being
prepared for dynamic bash-completion; there are bug fixes in
Cobra that are necessary for dynamic bash-completion to work
properly. Specifically,
    spf13/cobra#730
 which fixes
    spf13/cobra#694
is essential to avoid the risk of colliding and possibly
breaking kubectl dynamic bash-completion once helm v3 has its
own dynamic completion.

Signed-off-by: Marc Khouzam <marc.khouzam@ville.montreal.qc.ca>
marckhouzam added a commit to VilledeMontreal/helm that referenced this pull request Jun 3, 2019
The version of Cobra used in dev-v3 is older than the one used
for the master branch (helm v2). Although the dev-v3 branch
was based on master and therefore had the same Cobra version
originally, it was changed a couple of times to choose Cobra
tagged versions instead.

However, the currently used 0.0.3 version of Cobra is older than
the version of Cobra used on the master branch. Therefore, some of the
improvements made to Cobra and used by helm v2 are not available
to helm v3 currently.

This commit brings Cobra to its latest available version of 0.0.4.

Bringing Cobra up-to-date is essential for upcoming work being
prepared for dynamic bash-completion; there are bug fixes in
Cobra that are necessary for dynamic bash-completion to work
properly. Specifically,
    spf13/cobra#730
 which fixes
    spf13/cobra#694
is essential to avoid the risk of colliding and possibly
breaking kubectl dynamic bash-completion once helm v3 has its
own dynamic completion.

Signed-off-by: Marc Khouzam <marc.khouzam@ville.montreal.qc.ca>
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.

3 participants