monotone

Issue 141: Invariant when single letter option is completed to negated option variable

Reported by Thomas Keller, Feb 5, 2011

Steps to reproduce the problem:
-------------------------------

$ mtn push -b foo

Expected result:
----------------

mtn: option error: unknown option 'b'


Actual results:
---------------

mtn: fatal: error: option.cc:462: I(!is_cancel) 


Output of `mtn version --full`:
-------------------------------

0.99.1 and 0.99


The "b" of "-b" is tried to be completed and 
since push has no other options that start with "b", it 
only matches
the global option "builtin-rcfile", which is the 
"cancel" version of "no-builtin-rcfile". The 
option parser on the other hand does not expect a single letter 
option to be completed to a negated option of a long option and 
therefor hits the above invariant.

Possible solutions include removing the invariant altogether, 
completing only on "--", not on "-" or 
completing only when at least two letters are given. The second 
solution seems to make the most sense.

Comment 1 by Thomas Keller, Feb 5, 2011

Fixed in rev 649eb10a3481b527990a261b6e6297020d9aed22
Status: Fixed

Created: 13 years 9 months ago by Thomas Keller

Updated: 13 years 9 months ago

Status: Fixed

Owner: Thomas Keller

Labels:
Type:Incorrect Behavior
Priority:Medium
Milestone:1.0

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status