GithubHelp home page GithubHelp logo

Comments (5)

benedictpaten avatar benedictpaten commented on September 25, 2024

;) Can we not just substitute the default string to avoid having to
replicate arguments?

On Wed, Nov 20, 2013 at 12:49 PM, Dent Earl [email protected]:

Commit 76a4328 76a4328bdbroke argparse functionality by failing to maintain the new method of
displaying default values in help strings. The old, optparse method is to
use

help="blah blah blah default=%default"

and the argparse method, is to use

help="blah blah blah default=%(default)s"

The two methods are incompatible with one another, which was why we had
two methods to handle this.

76a432876a4328


Reply to this email directly or view it on GitHubhttps://github.com//issues/17
.

from jobtree.

dentearl avatar dentearl commented on September 25, 2024

I could see something like

if isinstance(addOptionFn, WhateverClassIsArgparseGroup):
  default_str = '%(default)s'
else:
  default_str = '%default'

And then having your help be like

... help='blah blah blah default=%s' % default_str)

But I haven't actually tested that, so I'm not sure it'll work but it's the first thing that pops into my head.

from jobtree.

benedictpaten avatar benedictpaten commented on September 25, 2024

If that's the issue it should work. Do you want me to do it? I did break it.

On Wed, Nov 20, 2013 at 1:17 PM, Dent Earl [email protected] wrote:

I could see something like

if isinstance(addOptionFn, WhateverClassIsArgparseGroup):
default_str = '%(default)s'else:
default_str = '%default'

And then having your help be like

... help='blah blah blah default=%s' % default_str)

But I haven't actually tested that, so I'm not sure it'll work but it's
the first thing that pops into my head.


Reply to this email directly or view it on GitHubhttps://github.com//issues/17#issuecomment-28931803
.

from jobtree.

dentearl avatar dentearl commented on September 25, 2024

Yes please :)

I think the only tricky part will be figuring out the correct class for the isinstance call

from jobtree.

benedictpaten avatar benedictpaten commented on September 25, 2024

Fixed

from jobtree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.