File: foo_command.py

package info (click to toggle)
python-cleo 2.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,120 kB
  • sloc: python: 8,293; makefile: 22; sh: 2
file content (27 lines) | stat: -rw-r--r-- 533 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from __future__ import annotations

from typing import TYPE_CHECKING
from typing import ClassVar

from cleo.commands.command import Command


if TYPE_CHECKING:
    from cleo.io.io import IO


class FooCommand(Command):
    name = "foo bar"

    description = "The foo bar command"

    aliases: ClassVar[list[str]] = ["afoobar"]

    def interact(self, io: IO) -> None:
        io.write_line("interact called")

    def handle(self) -> int:
        assert self._io is not None
        self._io.write_line("called")

        return 0