Author paul.j3
Recipients Robert, bethard, chris.jerdonek, docs@python, jeffknupp, paul.j3
Date 2013-04-17.04:14:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1366172076.48.0.619707550201.issue16988@psf.upfronthosting.co.za>
In-reply-to
Content
I've experimented with an argparse adaptation of profile.py:

    parser = argparse.ArgumentParser(usage=usage)
    parser.add_argument('-o', '--outfile', dest="outfile",
        help="Save stats to <outfile>", metavar="path")
    parser.add_argument('-s', '--sort', dest="sort",
        help="Sort order when printing to stdout ...",
        default=-1)
    parser.add_argument('args', nargs=argparse.PARSER,
        metavar="scriptfile [arg] ...") 
        # expect at least one positional, a py module

It is somewhat like subparsers, but without defined subparser choices.  Or you could say that PARSER (A...) is to REMAINDER (...) as '+' is to '*'.  It requires at least one argument.  I could, just as well, have created two arguments, 'scriptfile' and 'args' (with '...').

I don't know if that is an argument for documenting it or not.
History
Date User Action Args
2013-04-17 04:14:36paul.j3setrecipients: + paul.j3, bethard, chris.jerdonek, docs@python, jeffknupp, Robert
2013-04-17 04:14:36paul.j3setmessageid: <1366172076.48.0.619707550201.issue16988@psf.upfronthosting.co.za>
2013-04-17 04:14:36paul.j3linkissue16988 messages
2013-04-17 04:14:36paul.j3create