On 13 septembre 09:59, afayolle wrote: >> On jeu. 13 sept. 2012 09:30:40 CEST, Sylvain Thénault wrote: >> > On 13 septembre 15:37, mbp wrote: >> > That will make this option inconsistent with all the others, which seems a >> > bit likely to cause confusion. I wonder if at this point it is better for >> > pylint to just keep using -sy -iy etc. >> That's true as well, though that's someting I would like to change for a >> while (not enough to do it as you can see...). Anyone has an opinion on this >> here ? > > IMO, having to type -iy is a real pain, and I would really enjoy having > a CLI which does not break the least surprise principle[0]. > > A common way[1] of specifying boolean flags on the command line is to > have > > * a default value and a single short option to change the default > value, or two different short options (the last one on the command line > taking precedence) to set the true and false value > > * for long options, you generally get --xxx to set and --no-xxx to unset > > Having something like the above would certainly ease the first contact > with the tool. > > As the Pylint license makes if often necessary for IDEs and tools to > use shell calls to interface with Pylint, keeping a BW compatible > support would be nice. I'm not sure how much hacking in the guts of > optparse would be required to achieve this.
One could hack logilab.common.configuration so that store_true option implies addition of opposite --no-xxx option, storing false in the same variable. Regarding bw compat, the easiest way will probably be to use new option names, or do some options preprocessing to normalize things (and emit deprecation warning so we don't have to keep this forever). -- Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42) Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations Développement logiciel sur mesure: http://www.logilab.fr/services CubicWeb, the semantic web framework: http://www.cubicweb.org _______________________________________________ Python-Projects mailing list Python-Projects@lists.logilab.org http://lists.logilab.org/mailman/listinfo/python-projects