diff options
author | Craig Tiller <ctiller@google.com> | 2015-12-10 09:22:55 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-12-10 09:22:55 -0800 |
commit | 1fa1ab84c9ffc8d05b365165485c79cbf0496e33 (patch) | |
tree | 8f7b413cfa217e29fc57c91cd4339eefa411a932 /include | |
parent | 81e4e8dd0b47ddf805741cc4e0e24313a273cd5e (diff) |
Add cmdline tests
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc/support/cmdline.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/grpc/support/cmdline.h b/include/grpc/support/cmdline.h index 028dac2955..3058cf905a 100644 --- a/include/grpc/support/cmdline.h +++ b/include/grpc/support/cmdline.h @@ -83,8 +83,12 @@ void gpr_cmdline_add_string(gpr_cmdline *cl, const char *name, const char *help, void gpr_cmdline_on_extra_arg( gpr_cmdline *cl, const char *name, const char *help, void (*on_extra_arg)(void *user_data, const char *arg), void *user_data); -/* Parse the command line */ -void gpr_cmdline_parse(gpr_cmdline *cl, int argc, char **argv); +/* Enable surviving failure: default behavior is to exit the process */ +void gpr_cmdline_set_survive_failure(gpr_cmdline *cl); +/* Parse the command line; returns 1 on success, on failure either dies + (by default) or returns 0 if gpr_cmdline_set_survive_failure() has been + called */ +int gpr_cmdline_parse(gpr_cmdline *cl, int argc, char **argv); /* Destroy the parser */ void gpr_cmdline_destroy(gpr_cmdline *cl); /* Get a string describing usage */ |