Skip to content

Commit b20e038

Browse files
committed
chore: use translations on csm-data main command
1 parent 0749f98 commit b20e038

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

cosmotech/csm_data/main.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
def print_version(ctx, param, value):
2525
if not value or ctx.resilient_parsing:
2626
return
27-
click.echo(f"Cosmo Tech Data Interface {__version__}")
27+
click.echo(T("csm_data.commons.version.message").format(version=__version__))
2828
ctx.exit()
2929

3030

31-
@click.group("csm-data")
31+
@click.group("csm-data", invoke_without_command=True)
32+
@click.pass_context
3233
@click_log.simple_verbosity_option(LOGGER, "--log-level", envvar="LOG_LEVEL", show_envvar=True)
3334
@click.option(
3435
"--version",
@@ -40,8 +41,9 @@ def print_version(ctx, param, value):
4041
)
4142
@web_help("csm-data")
4243
@translate_help("csm_data.commands.main.description")
43-
def main():
44-
pass
44+
def main(ctx):
45+
if ctx.invoked_subcommand is None:
46+
click.echo(T("csm_data.commands.main.content"))
4547

4648

4749
main.add_command(api, "api")

cosmotech/translation/csm_data/en-US/csm_data/commands/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
content: |
2+
Welcome to the Cosmo Tech Data Interface command line interface (CLI) tool.
3+
This tool provides a set of commands to help you manage your data connections and configurations.
14
description: |
25
Cosmo Tech Data Interface
36
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
message: |
2+
Cosmo Tech Data Interface {version}
3+
4+
Copyright © 2023-2025 Cosmo Tech

0 commit comments

Comments
 (0)