Support old-style flags even in the new flag system.

Review Request #1093 — Created Oct. 1, 2014 and submitted

benjyw
pants
752e815...
pants-reviews
patricklaw

E.g., --compile-java-foo-bar anywhere on the cmd-line is the same
as ./pants compile.java --foo-bar.

This will make migration easier, as people are used to the old style,
and we may even want to keep this forever, if some users prefer
the verbose flags.

Ran all the tests.

  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
PA
  1. lgtm minus nits

  2. src/python/pants/option/arg_splitter.py (Diff revision 1)
     
     

    Even as a comment, this should go to sys.stderr

  3. src/python/pants/option/arg_splitter.py (Diff revision 1)
     
     

    Off the cuff: this might be a handy place to check to see if an arg starts with emdash and yell about it. It's a surprisingly common mistake and the error message is often incomprehensible.

  4. src/python/pants/option/arg_splitter.py (Diff revision 1)
     
     

    I prefer a format string, even in trivial situations

  5. 
      
ZU
  1. Thanks Benjy. I hope to one day grow to love the new way of specifying options, but this will really smooth the way.

  2. 
      
BE
  1. Thanks for the quick review!

  2. src/python/pants/option/arg_splitter.py (Diff revision 1)
     
     

    Weird. How does that happen?

    I'll add that in a separate change. This isn't the only place in the code where that check would need to happen.

    1. People have auto-emdash turned on in chat or whatever, then copy paste a command from an IM, then spend a half hour trying to figure out what some weird unicode decode error means. Then again, that might occur in a different code path before we get to this point.

  3. src/python/pants/option/arg_splitter.py (Diff revision 1)
     
     

    I don't necessarily agree. It brings in extra machinery (the format string parser) where it's not needed. Obviously the performance impact is undetectable in this case, but as a matter of esthetics I prefer to keep things that can be simple, simple...

  4. 
      
BE
Review request changed

Status: Closed (submitted)

Loading...