question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using Cleo instead of Argparse

See original GitHub issue

Currently, Manim uses Argparse for handling CLI arguments. It has been good but hard to maintain it, the currently introduced subcommands make it worse. Using something which was built for CLI management would help a lot of something like Cleo.

Cleo allows us to create beautiful and testable command-line commands. (Picked from docs) Where it uses docstrings to generate a command argument. (Bonus it allow autocompletion https://cleo.readthedocs.io/en/latest/introduction.html#autocompletion).

Many projects use this for CLI for example poetry.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:24 (21 by maintainers)

github_iconTop GitHub Comments

4reactions
leotrscommented, Oct 29, 2020

You are very convincing. I vote we go with the one that is the most supported, but let’s do this after #620 is merged and stabilizes a bit.

Cc @ManimCommunity/core to hear from others.

3reactions
leotrscommented, Nov 30, 2020

From the cleo documentation:

As you may have already seen, Cleo uses the command docstring to determine the command definition. The docstring must be in the following form :

I am strongly against introducing functionality in the docstrings, so I would vote against using cleo. Also, click seems to have a wider audience (and thus, possibly, better support).

However, the person who works on this should have final say, so let’s discuss once there’s a PR 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cleo: create beautiful and testable command-line interfaces
Instead of parsing the whole thing at once (as argparse does), it parses only the relevant part for the current context which makes...
Read more >
Comparing Python Command-Line Parsing Libraries
Here we'll compare three command-line parsing libraries - argparse, docopt, and click.
Read more >
Accept unknown options (for poetry plugin) · Issue #126 - GitHub
I require a way to make a cleo Command accept unknown options and arguments, and not inherit the application options. The equivalent in...
Read more >
Python CLI libraries analysis - The CZ.NIC Staff Blog
We want to design a command with following usage based on ... argparse is part of standard library, so no external dependecies are...
Read more >
Please don't use Click - Karol Kuczmarski
If you care about your command line interface, consider just using the argparse module. Yes, it will force you to create parser objects, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found