forked from aws/aws-sam-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand.py
More file actions
32 lines (22 loc) · 911 Bytes
/
Copy pathcommand.py
File metadata and controls
32 lines (22 loc) · 911 Bytes
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
28
29
30
31
32
"""
Base command class for local callback commands
"""
from abc import abstractmethod
from click import Context
from samcli.cli.core.command import CoreCommand
from samcli.cli.core.options import ALL_COMMON_OPTIONS
from samcli.commands.common.formatters import CommandHelpTextFormatter
class LocalCallbackFormatterClass(CommandHelpTextFormatter):
def __init__(self, *args, **kwargs):
super().__init__(ALL_COMMON_OPTIONS, *args, **kwargs)
class LocalCallbackCommand(CoreCommand):
"""
Base command class for local callback commands.
"""
class CustomFormatterContext(Context):
formatter_class = LocalCallbackFormatterClass
context_class = CustomFormatterContext
@abstractmethod
def format_examples(self, ctx: Context, formatter: CommandHelpTextFormatter):
"""Override this method in subclasses to provide command-specific examples."""
pass