Checkout
Karl Fogel
committed
on 28 Sep 02
Move help parsing and regular argument parsing over to svn_opt. This
finishes the abstraction, started in revision 3239, needed to fix
svna… Show more
Move help parsing and regular argument parsing over to svn_opt.  This

finishes the abstraction, started in revision 3239, needed to fix

svnadmin and svnlook to do real command line parsing.

* subversion/clients/cmdline/util.c

 (DEFAULT_ARRAY_SIZE, array_push_str, parse_path): Moved to opt.c.

 (svn_cl__push_implicit_dot_target): Moved to the opt api, and

 renamed svn_opt_push_implicit_dot_target.  All callers changed.

 (svn_cl__parse_num_args): Moved to the opt api, and renamed

 svn_opt_parse_num_args.  All callers changed.

 (svn_cl__parse_all_args): Moved to the opt api, and renamed

 svn_opt_parse_all_args.  All callers changed.

 (svn_cl__args_to_target_array): Moved to the opt api, and renamed

 svn_opt_args_to_target_array.  Interface tweaked so no longer

 dependent on svn_cl__opt_state.  All callers changed.

* subversion/clients/cmdline/help-cmd.c

 (print_version_info): Moved to opt.c and rewritten.

 (svn_cl__help): Rewrite to use svn_opt_print_help.

* subversion/clients/cmdline/cl.h

 (svn_cl__push_implicit_dot_target, svn_cl__parse_num_args,

 svn_cl__parse_all_args, svn_cl__args_to_target_array): Removed, see

 above.

 (svn_cl__push_svn_string): Removed this unimplemented prototype.

* subversion/libsvn_subr/opt.c: Include assert.h.

 (DEFAULT_ARRAY_SIZE, array_push_str): Moved here from util.c.

 (parse_path): Moved here from util.c, and tweaked not to use an

 unnecessary svn_cl__opt_state structure internally.

 (svn_opt_push_implicit_dot_target, svn_opt_parse_num_args,

 svn_opt_parse_all_args, svn_opt_args_to_target_array): New

 functions, see above.

 (print_version, svn_opt_print_help): New functions, code brought

 over from help-cmd.c.

* subversion/include/svn_opt.h

 (svn_opt_push_implicit_dot_target, svn_opt_parse_num_args,

 svn_opt_parse_all_args, svn_opt_args_to_target_array,

 svn_opt_print_help): Prototypes for above-mentioned new functions.

* subversion/tests/clients/cmdline/getopt_tests_data/svn--version_stdout,

 subversion/tests/clients/cmdline/getopt_tests_data/svn_stderr:

 Adjust for new output.

Show less