Skip to content

Exit with message #48

Description

@joshua-light

As a CLI developer, I want to be able to exit from app with message and code.

API

from candies.cli import cli, Arg, Exit

@cli
def divide(x: Arg[int], y: Arg[int]):
    if y == 0:
        raise Exit(f'Cannot divide {x} by zero')

    print(x / y)

Requirements

  • Code should be tested.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions