Skip to content

def _hidden() functions

If function name starts from an underscore, it will not be converted to a command.

That is useful for helper reusable functions.

jeeves.py
def _format_greeting(name: str) -> str:
    return f'Hello {name}!'


def hi(name: str):
    """Greet the user."""
    print(_format_greeting(name))

j
 Usage: j [OPTIONS] COMMAND [ARGS]...                                           

╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --log-level                 [debug|info|error]  Logging level.               │
│                                                 [default: LogLevel.ERROR]    │
│ --install-completion                            Install completion for the   │
│                                                 current shell.               │
│ --show-completion                               Show completion for the      │
│                                                 current shell, to copy it or │
│                                                 customize the installation.  │
│ --help                                          Show this message and exit.  │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ hi           Greet the user.                                                 │
╰──────────────────────────────────────────────────────────────────────────────╯