#1 Fix handling of -- as an option value

closed-accepted
Greg Ward
None
5
2001-12-07
2001-11-13
Matthew Mueller
No

If you try to pass -- to an option, optik 1.0 will
instead think you are trying to end the option
processing. But this is inconsistant with both GNU and
Python getopt. (And inconsistant with my expectations.)

Patch also updates the test case.

Discussion

  • Greg Ward
    Greg Ward
    2001-11-28

    Logged In: YES
    user_id=14422

    Oops -- I never saw this patch when it was first submitted,
    and now it's way out of date. Even worse, you're *right* --
    Optik's handling of "--" is inconsistent with GNU's, which
    is my gold standard. Sigh.

    Would you mind reworking this patch against the current CVS
    (which, at the moment, is Optik 1.1.1)? Thanks!

     
  • Greg Ward
    Greg Ward
    2001-11-28

    • assigned_to: nobody --> gward
     
  • Logged In: YES
    user_id=65253

    Here is an updated patch for Optik 1.1.1.

    Like the old patch, it does away with the _split_args method
    since it would have to duplicate all the arg handling code
    of _process_arg and friends just to figure out when to
    ignore the --.

    It also happens to fix the inconsistancy in stopping arg
    processing on a "-" arg even if allow_interspersed_args is
    set. (Matches GNU getopt now)

     
  • Greg Ward
    Greg Ward
    2001-12-07

    Logged In: YES
    user_id=14422

    Perfect! Thank you, patch applied as-is.

     
  • Greg Ward
    Greg Ward
    2001-12-07

    • status: open --> closed-accepted