[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Change ARG_PARSING_ERR to INSUFFICIENT_ARGS

From: Hyrum K. Wright <hyrum_wright_at_byu.edu>
Date: 2005-11-10 04:37:55 CET

In many places in the command line client application, we return a
SVN_ERR_CL_ARG_PARSING_ERR when we try to run a command that needs
arguments. One notable except is the merge command, which returns a
SVN_ERR_CL_INSUFFICIENT_ARGS error instead. This more closely matches
the nature of the error, we haven't errored because we can't parse the
arguments, we've errored because there are an insufficient number of them.

Because this error occurs when the user hasn't fed us enough arguments,
the generic error message has also been changed to suggest they run help
for more information.

Also, the method of checking the number of arguments was a little
inconsistent between commands, so I've fixed that as well.

This patch complements Julian Foad's patch[1], because it causes a
semi-useful error message to be displayed, instead of running the
command help when no arguments are passed. These error messages should
probably be touched up to reflect the individual nature of the commands,
but that can be done in another patch.

-Hyrum

[1] http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=108158

[[[
Replace some occurrences of SVN_ERR_CL_ARG_PARSING_ERR in favor of
SVN_ERR_CL_INSUFFICIENT_ARGS. INSUFFICIENT_ARGS better matches the
meaning of what we were using ARG_PARSING_ERR for. Also, update the
generic error message to suggest running help.

* subversion/include/svn_error_codes.h
  (SVN_ERR_CL_INSUFFICIENT_ARGS): Add suggestion to run svn help.

* subversion/libsvn_subr/opt.c
  (svn_opt_parse_num_args): Replace SVN_ERR_CL_ARG_PARSING_ERR in favor
  of SVN_ERR_CL_INSUFFICIENT_ARGS.

[in subversion/clients/cmdline]

* checkout-cmd.c
  (svn_cl__checkout): Replace SVN_ERR_CL_ARG_PARSING_ERR in favor
  of SVN_ERR_CL_INSUFFICIENT_ARGS, and update a comment.

* import-cmd.c
  (svn_cl__import): Split the conditional checking for arguments and
  replace SVN_ERR_CL_ARG_PARSING_ERR in favor of
  SVN_ERR_CL_INSUFFICIENT_ARGS. This is consistent with svn_cl__export.

* mkdir-cmd.c (svn_cl__mkdir),
  cat-cmd.c (svn_cl__cat),
  revert-cmd.c (svn_cl__revert),
  blame-cmd.c (svn_cl__blame),
  resolved-cmd.c (svn_cl__resolved),
  add-cmd.c (svn_cl__add),
  switch-cmd.c (svn_cl__switch),
  lock-cmd.c (svn_cl__lock),
  unlock-cmd.c (svn_cl__unlock): Replace SVN_ERR_CL_ARG_PARSING_ERR in
  favor of SVN_ERR_CL_INSUFFICIENT_ARGS.

]]]

Received on Thu Nov 10 04:38:38 2005

This is an archived mail posted to the Subversion Dev mailing list.