feat(cli): Better organized CLI arg parsing
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import argparse as ap
|
||||
|
||||
|
||||
def add_parser(sp: ap._SubParsersAction[ap.ArgumentParser]):
|
||||
config = sp.add_parser(
|
||||
"config", help="prints information about your config and change some of them"
|
||||
)
|
||||
conf_sp = config.add_subparsers(title="config options", dest="conf", required=True)
|
||||
conf_sp.add_parser("show", help="show config options")
|
||||
config_update = conf_sp.add_parser(
|
||||
"update", help="update the configuration from various"
|
||||
)
|
||||
conf_update_sp = config_update.add_subparsers(
|
||||
title="Options for automatic configuration updates",
|
||||
dest="conf_update",
|
||||
required=True,
|
||||
)
|
||||
conf_update_sp.add_parser(
|
||||
"pkgs",
|
||||
help="Update the config to reflect the package state of the current system",
|
||||
)
|
||||
Reference in New Issue
Block a user