[ldapvi] Option -b does not override base: in .ldapvirc

David Lichteblau david at lichteblau.com
Thu Aug 16 14:21:23 CEST 2007


Quoting Jan-Piet Mens (jpmens at gmail.com):
> ldapvi 1.7 with an .ldapvirc containing a "base: dc=example,dc=com"
> directive works fine. If I use the -b option to ldapvi, I'd have liked
> the search base overriden, but that doesn't happen.
> 
> Is that a bug or a feature request? ;-)

Good question.

The profile is processed first, then the command line arguments.  For
most arguments, the last occurance of a parameter overrides earlier
uses.  But -b can be specified multiple times, and the search will be
repeated for each of them.

So in this case, ldapvi will perform two searches, one for the base in
.ldapvirc and one for the command line option, and concatenate the
results.

I can see why that behaviour is not optimal, but for consistency in
command line parsing, changing the behaviour of -b unconditionally seems
unattractive.

How about a configuration option that explicitly declares itself as an
optional fall-back value?  Perhaps `default-base' would be a good name.

So with
  profile foo
  default-base dc=example,dc=com
in .ldapvirc and
  ldapvi -p foo -b dc=other,dc=com
on the command line, only the latter would be used, but behaviour would
be unchanged for ordinary 'base' options in the configuration file.



More information about the ldapvi mailing list