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

[PATCH] Spell-check --config-option

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Wed, 1 Apr 2015 10:17:59 +0000

The attached patch enables the following behaviour:

    % svn --config-option=config:auth:password-stories= status iota
    svn: warning: apr_err=SVN_ERR_CL_ARG_PARSING_ERROR
    svn: warning: W205000: Ignoring unknown value 'password-stories'; did you mean 'password-stores'?
    M iota
                                                                                    
    % svn --config-option=config:foobar:password-stores= status iota
    svn: warning: apr_err=SVN_ERR_CL_ARG_PARSING_ERROR
    svn: warning: W205000: Ignoring unknown value 'foobar'
    M iota

The combination itself is not validated: a correctly-spelled option in
the wrong section (such as config:helpers:http-library=...) won't
trigger a warning.

Unknown options will cause warnings even if they are used by the
substitution syntax, e.g.,
   --config-option config:auth:foo=bar
will trigger a warning about 'foo', even if
   --config-option 'config:auth:password-stores=%(foo)s'
is specified on the command-line or in the --config-dir. (If this is
a concern, we could move the spell-checking to a later point in the
argument parsing sequence, after the configuration from --config-dir has
been loaded.)

Log message skeleton:

[[[
* gen-make.py:
    Generate a list of SVN_CONFIG_* file/section/option names for the
    svn_cmdline_*() C code to use.

* subversion/libsvn_subr/cmdline.c
  (svn_cmdline__parse_config_option):
    When parsing the argument to --config-option, spell-check the
    FILE:SECTION:OPTION coordinates, and warn if any component is
    unknown.
]]]

Thoughts?

Daniel
(I'm going to be mostly offline for a few days; will reply when I'm back)

Received on 2015-04-01 12:18:32 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.