-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Option handling improvements #2991
Conversation
…nd line option. Don't output error message twice.
…he error message.
…ons in bulk loader with --files to match live loader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 7 of 7 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @codexnull)
dgraph/cmd/live/run.go, line 351 at r1 (raw file):
if opt.dataFiles == "" { return errors.New("RDF or JSON file(s) location must be specified\n")
instances of type error should not have a new line at the end of the message.
dgraph/cmd/live/run.go, line 357 at r1 (raw file):
totalFiles := len(filesList) if totalFiles == 0 { return fmt.Errorf("No data files found in %s\n", opt.dataFiles)
No new line here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 6 of 7 files reviewed, 2 unresolved discussions (waiting on @martinmr)
dgraph/cmd/live/run.go, line 351 at r1 (raw file):
Previously, martinmr (Martin Martinez Rivera) wrote…
instances of type error should not have a new line at the end of the message.
Done.
dgraph/cmd/live/run.go, line 357 at r1 (raw file):
Previously, martinmr (Martin Martinez Rivera) wrote…
No new line here as well
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 6 of 7 files reviewed, 3 unresolved discussions (waiting on @codexnull and @martinmr)
dgraph/cmd/live/run.go, line 187 at r2 (raw file):
loadType = chunker.JsonFormat } else { return fmt.Errorf("Need --format=rdf or --format=json to load %s", filename)
Minor: lower case error strings https://github.com/golang/go/wiki/CodeReviewComments#error-strings
Otherwise LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 6 of 7 files reviewed, 3 unresolved discussions (waiting on @codexnull and @martinmr)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 6 of 7 files reviewed, 3 unresolved discussions (waiting on @codexnull and @martinmr)
dgraph/cmd/live/run.go, line 87 at r3 (raw file):
flag.StringP("files", "f", "", "Location of *.rdf(.gz) or *.json(.gz) file(s) to load") flag.StringP("schema", "s", "", "Location of schema file") flag.String("format", "", "Specify file format (rdf or json) instead of getting it from filename")
100 chars.
* A user should not be faced with a stack trace due to a mistyped command line option. Don't output error message twice. * Don't output usage on invalid command line option since it can bury the error message. * Add --format option to bulk and live loaders. Replace --rdfs and --jsons in bulk loader with --files to match live loader. * Fix errant newlines in error messages. * Fix error message.
This change is