Skip to content

[Refactoring] Use Typer instead of argparse? #43

Closed
@paketb0te

Description

@paketb0te

Hi @initialcommit-io , it's me again 😆

With the inheritance model simplified, I think there is one other thing we could greatly improve - the way the command line arguments are handled.

I am a big fan of Typer, that tool makes it super easy to manage all that stuff - and it gives type hints!

The docs are also great and explain the whole concept better than I could ever do here, so maybe you want to have a look at that :)

I have worked on a branch showcasing the concept for some of the commands (log and status for now), check it out: typer

The basic idea is that each command is a function, and the function arguments are the corresponding CLI arguments / flags / options. But we don't have to do all that argparse stuff (setting up parsers and subparsers in main(), and having to sync that with the args.subcommand in the actual Command classes ...).

Let me know if you like it!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions