Git Product home page Git Product logo

Comments (5)

evanunderscore avatar evanunderscore commented on September 25, 2024

Thanks for the report. I have no plans to implement this myself, but would happily take a PR if you or someone else would like to do it.

It should be relatively easy to alter the subcommand names; you can see where defopt sets the name of the subcommand here. Aliases might be a little harder since I don't believe argparse supports alises for subcommands out of the box. You might have to look at how argh/clize work for inspiration.

from defopt.

anntzer avatar anntzer commented on September 25, 2024

I don't believe argparse supports alises for subcommands out of the box.

It does (via the not so well documented aliases argument to add_parser(), https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_subparsers), although it's Py3 only I think.

from defopt.

evanunderscore avatar evanunderscore commented on September 25, 2024

Thanks, I wasn't aware of that. I'm fine with having this be a Python 3 only feature if it eases the implementation.

from defopt.

johnfarina avatar johnfarina commented on September 25, 2024

Thanks for the pointer into the code! Now that I've had a look, it's actually easy to implement clize-style function renaming by passing a dict to defopt.run. I'll submit a PR once I update the documentation on my fork and figure out how to add unittests :)

I'm less interested in assigning multiple aliases to a given function.

from defopt.

anntzer avatar anntzer commented on September 25, 2024

Implemented in 176cd55.

from defopt.

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.