You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The option handling has issues due to using both the standard flag package as well as Cobra/Viper. For example, running "dgraph --help" outputs
Usage of dgraph:
-alsologtostderr
log to standard error as well as files
-log_backtrace_at value
when logging hits line file:N, emit a stack trace
-log_dir string
If non-empty, write log files in this directory
-logtostderr
log to standard error instead of files
-stderrthreshold value
logs at or above this threshold go to stderr
-v value
log level for V logs
-vmodule value
comma-separated list of pattern=N settings for file-filtered logging
because which is
Incorrect. -alsologtostderr is not a valid option, --alsologtostderr is.
Not useful.
This behavior can be confusing to new users.
This example could be fixed by removing the call to flag.Parse() and just letting Cobra do all argument handling, but then the glog package complains that flag.Parse() has not been called, and that still leaves other issues (e.g. #2842, #2854), so something else needs to be done to make option handling more sane.
The text was updated successfully, but these errors were encountered:
We can fork glog and move that over to Cobra. But, the main issue here is that the way cobra handles flags is just annoying. Every flag needs to be defined and then retrieved back to see what the value is. Instead, we can just parse the config file ourselves (very easy to do) and set the flags values, before they are accessed by rest of the code. That way we don't need to call Gets on each and every flag.
The option handling has issues due to using both the standard flag package as well as Cobra/Viper. For example, running "dgraph --help" outputs
because which is
This behavior can be confusing to new users.
This example could be fixed by removing the call to flag.Parse() and just letting Cobra do all argument handling, but then the glog package complains that flag.Parse() has not been called, and that still leaves other issues (e.g. #2842, #2854), so something else needs to be done to make option handling more sane.
The text was updated successfully, but these errors were encountered: