![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
paul j3 added the comment: 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. ---------- nosy: +paul.j3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16988> _______________________________________