This repository was archived by the owner on Apr 3, 2018. It is now read-only.
virtc: Check mandatory command-line arguments. - #165
Merged
Merged
Conversation
sboeuf
reviewed
Mar 22, 2017
|
|
||
| id := context.String("id") | ||
| if id != "" { | ||
| return nil |
Collaborator
There was a problem hiding this comment.
You should test id == "" and return the error here, rather than return nil from here. It would be more consistent with the way we write functions usually, don't you think ?
Collaborator
|
@jodh-intel only one comment, and you also need to fix travis, but other than that, we can merge this. |
jodh-intel
force-pushed
the
check-cli-arguments
branch
from
March 23, 2017 09:15
f9f1bec to
1924e60
Compare
Collaborator
Author
|
Hi @sboeuf - I've fixed the main issue causing the Travis failure. However, I was then seeing test |
This was referenced Mar 23, 2017
Collaborator
Ensure that all mandatory arguments are checked early. Note that urfave/cli doesn't actually provide such a feature. The approach taken attempts to avoid duplicated code by checking centrally, rather than peppering checks on podID and containerID in lots of functions. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
jodh-intel
force-pushed
the
check-cli-arguments
branch
from
March 23, 2017 14:44
1924e60 to
bce9c9d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ensure that all mandatory arguments are checked early.
Note that urfave/cli doesn't actually provide such a feature. The
approach taken attempts to avoid duplicated code by checking centrally,
rather than peppering checks on podID and containerID in lots of
functions.
Signed-off-by: James O. D. Hunt james.o.hunt@intel.com