You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
change --long-opts to use = when given a value? #13
Some commands won't parse --long-opt val as a long option with a value.
I'd like to change this to use an = sign.
Of course this could be made configurable, but that makes things more complex.
I don't think the opposite problem happens; I don't believe there's any command that prefers the no-equal-sign syntax.
$ git log -1 --stat 999
fatal: ambiguous argument '999': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
$ git log -1 --stat=999
commit 6e3a6b25d8b825e262a8b346e4a005fd10734958
Merge: c329460 788a116
Author: Mike Thornton <msthornton@gmail.com>
Date: Mon Oct 13 13:53:03 2014 -0500
Merge pull request #8 from bukzor/buck-repr-quotes
leverage built-in repr to make proper string reprs
Agreed it's a better defeat to have =. What about short ops with values? I've been thinking about how to do settings like telling clom which param format to use. Don't want to clutter the kwargs as it might clash with a command's option. Might have to do 'with_settings(opt_val_sep=" ")' or the like.
Maybe clom should have ext support that has preconfigured options for common commands. That could make it too complicated though.
Some commands won't parse --long-opt val as a long option with a value.
I'd like to change this to use an = sign.
Of course this could be made configurable, but that makes things more complex.
I don't think the opposite problem happens; I don't believe there's any command that prefers the no-equal-sign syntax.
—
Reply to this email directly or view it on GitHub.
Values for short opts varies a bit, but I think what's there now (-x 1) is the common denominator. -x1 can be interpreted as -x 1 or as -x -1, depending on the parser. -x=1 isn't a thing I've ever seen.
If it's needed I think .with_settings is the way to go, but I think we should wait till it proves needed. It might not be.
$ curl -iv --max-redirs=0 http://google.com
curl: option --max-redirs=0: is unknown
curl: try 'curl --help' or 'curl --manual' for more information
$ curl -iv --max-redirs 0 http://google.com
* Rebuilt URL to: http://google.com/
So this certainly needs to be optional. It may be the best default though. Need to check out a few common commands and see which is more supported, = or .
I've noticed that clom has a problem that mock.Mock also has: if you
mis-remember / typo a method name, it does the Wrong Thing silently, which
is a very stinky smell. It would be best to separate the auto-magical
namespace from the well-known-methods namespace.
Do you have any ideas on that front? I think we'd have to decide which one
wins. If the auto-magic wins, x.clom puts us back to the well-known
methods. If methods win, .args puts us into the auto-magic namespace.
Actually I can make both branches relatively easily, we we can decide which is nicer (or neither) after looking at them.
Activity
bukzor commentedon Jan 29, 2015
For example:
six8 commentedon Jan 29, 2015
Agreed it's a better defeat to have =. What about short ops with values? I've been thinking about how to do settings like telling clom which param format to use. Don't want to clutter the kwargs as it might clash with a command's option. Might have to do 'with_settings(opt_val_sep=" ")' or the like.
Maybe clom should have ext support that has preconfigured options for common commands. That could make it too complicated though.
bukzor commentedon Jan 29, 2015
Values for short opts varies a bit, but I think what's there now (
-x 1) is the common denominator.-x1can be interpreted as-x 1or as-x -1, depending on the parser.-x=1isn't a thing I've ever seen.If it's needed I think .with_settings is the way to go, but I think we should wait till it proves needed. It might not be.
long options use an equal sign now
six8 commentedon Feb 5, 2015
Curl doesn't like the
=:So this certainly needs to be optional. It may be the best default though. Need to check out a few common commands and see which is more supported,
=or.bukzor commentedon Feb 5, 2015
sadness
bukzor commentedon Feb 5, 2015
Do we add a new .configure method?
six8 commentedon Feb 5, 2015
I guess we go with
with_settingsas it's less likely to clash with an actual command.bukzor commentedon Feb 5, 2015
I've noticed that clom has a problem that mock.Mock also has: if you
mis-remember / typo a method name, it does the Wrong Thing silently, which
is a very stinky smell. It would be best to separate the auto-magical
namespace from the well-known-methods namespace.
Do you have any ideas on that front? I think we'd have to decide which one
wins. If the auto-magic wins, x.clom puts us back to the well-known
methods. If methods win, .args puts us into the auto-magic namespace.
Actually I can make both branches relatively easily, we we can decide which is nicer (or neither) after looking at them.
six8 commentedon Mar 4, 2016
You could also forget the namespace. Ex:
If we said "with_*" is a namespace, we could error. However if you typo'd "with" you'd still end up with it doing the wrong thing.