Skip to content

fixes verbose tests by checking if the first arg belongs to cobra#182

Merged
spf13 merged 1 commit into
spf13:masterfrom
apriendeau:fixes-verbose-test
Nov 7, 2015
Merged

fixes verbose tests by checking if the first arg belongs to cobra#182
spf13 merged 1 commit into
spf13:masterfrom
apriendeau:fixes-verbose-test

Conversation

@apriendeau
Copy link
Copy Markdown

This should fix the tests by checking if first arg is the same as the name as the root command in cobra. Replaces PR #155 @eparis @spf13 @anthonyfok

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
All committers have accepted the CLA.

@spf13 spf13 merged commit 62e859a into spf13:master Nov 7, 2015
@spf13
Copy link
Copy Markdown
Owner

spf13 commented Nov 7, 2015

pushed as 62e859a

@anthonyfok
Copy link
Copy Markdown
Collaborator

Hi @spf13,

Sorry for my earlier premature recommendation for the fix. It turns out that this patch has undesirable side-effects: Specifying full path to the executable, or renaming the executable, would make it ignore any command-line arguments. Using hugo as example:

    $ ~/go/bin/hugo --help

    $ mv hugo hhuuggoo
    $ hhuuggoo server

All subcommands and flags are ignored...

I discovered this problem when trying to sudo ~/go/bin/hugo genautocomplete. At first, I thought it was the sudo, but it turns out sudo hugo works well; the problem came from the full path to the hugo executable.

@apriendeau, any ideas of an alternative solution? :-)

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.

4 participants