From 838f27f7c96097128695c47238469b5c59a64b8c Mon Sep 17 00:00:00 2001 From: Michael Sprengel Date: Mon, 18 Dec 2023 15:23:28 +0100 Subject: [PATCH] Fix program name for CLI commands --- src/glvd/cli/client/__init__.py | 2 +- src/glvd/cli/data/__init__.py | 2 +- src/glvd/cli/registry.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/glvd/cli/client/__init__.py b/src/glvd/cli/client/__init__.py index d15929a..2ac3d0e 100644 --- a/src/glvd/cli/client/__init__.py +++ b/src/glvd/cli/client/__init__.py @@ -5,7 +5,7 @@ from ..registry import CliRegistry -cli = CliRegistry() +cli = CliRegistry('glvd') cli.add_argument( '--server', diff --git a/src/glvd/cli/data/__init__.py b/src/glvd/cli/data/__init__.py index b1fdb9c..e2de6ff 100644 --- a/src/glvd/cli/data/__init__.py +++ b/src/glvd/cli/data/__init__.py @@ -5,7 +5,7 @@ from ..registry import CliRegistry -cli = CliRegistry() +cli = CliRegistry('glvd-data') cli.add_argument( '--database', diff --git a/src/glvd/cli/registry.py b/src/glvd/cli/registry.py index 942210c..d060d5a 100644 --- a/src/glvd/cli/registry.py +++ b/src/glvd/cli/registry.py @@ -21,10 +21,10 @@ class CliRegistry: arguments: list[_ActionWrapper] - def __init__(self) -> None: + def __init__(self, name: str) -> None: self.parser = argparse.ArgumentParser( allow_abbrev=False, - prog='glvd', + prog=name, formatter_class=argparse.ArgumentDefaultsHelpFormatter, ) self.subparsers = self.parser.add_subparsers(