From b8db154c1dfd568c783b02dee65ae421ca641ab1 Mon Sep 17 00:00:00 2001 From: Andrei Date: Mon, 25 Nov 2024 17:52:05 +0100 Subject: [PATCH] Fix application name in help --- make_argocd_fly/main.py | 2 +- make_argocd_fly/resource.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/make_argocd_fly/main.py b/make_argocd_fly/main.py index 3be6cf4..44b6a73 100644 --- a/make_argocd_fly/main.py +++ b/make_argocd_fly/main.py @@ -63,7 +63,7 @@ async def generate() -> None: def main() -> None: - parser = argparse.ArgumentParser(description='Render ArgoCD Applications.') + parser = argparse.ArgumentParser(prog='make-argocd-fly', description='Render ArgoCD Applications.') parser.add_argument('--root-dir', type=str, default=os.getcwd(), help='Root directory (default: current directory)') parser.add_argument('--config-file', type=str, default=CONFIG_FILE, help='Configuration file (default: config.yml)') parser.add_argument('--source-dir', type=str, default=SOURCE_DIR, help='Source files directory (default: source)') diff --git a/make_argocd_fly/resource.py b/make_argocd_fly/resource.py index eda720e..7104958 100644 --- a/make_argocd_fly/resource.py +++ b/make_argocd_fly/resource.py @@ -21,10 +21,12 @@ def increase_indent(self, flow=False, *args, **kwargs): def represent_str(dumper, data): - """configures yaml for dumping multiline strings + """configures pyyaml for dumping multiline strings Ref: https://stackoverflow.com/questions/8640959/how-can-i-control-what-scalar-form-pyyaml-uses-for-my-data""" if data.count('\n') > 0: return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='|') + """configure pyyaml for dumping numbers that start with 0 as strings + Ref: https://github.com/yaml/pyyaml/issues/98""" if data.startswith('0'): try: int(data[1:])