Files
Argenta/docs/code_snippets/command/snippet.py
T
2025-11-02 01:04:31 +03:00

22 lines
656 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from argenta import Command
from argenta.command import Flag, Flags
# Простая команда без флагов
hello_cmd = Command("hello", description="Greet the user")
# Команда с описанием и псевдонимами
quit_cmd = Command("quit", description="Exit the application", aliases=["exit", "q"])
# Команда с флагами
deploy_cmd = Command(
"deploy",
description="Deploy application to server",
flags=Flags(
[
Flag("env", help="Environment name", possible_values=["dev", "prod"]),
Flag("force", help="Force deployment"),
]
),
aliases=["dep"],
)