Command execution¶
commands ¶
Dispatch validated CLI commands to the public pipeline APIs.
The runtime layer resolves all user input before this module is called. Each
handler therefore performs only workflow dispatch and concise terminal
reporting; report generation and optional writes remain owned by
hotstring.pipeline.
execute_command ¶
execute_command(
command: CommandConfig,
*,
logger: Logger | None = None,
output: TextIO | None = None,
) -> int
Execute one validated command and print its summary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
CommandConfig
|
Runtime command created by
|
required |
logger
|
Logger | None
|
Optional orchestration logger forwarded to typo-generation pipelines. |
None
|
output
|
TextIO | None
|
Optional output stream. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Zero after successful pipeline execution. |
Source code in hotstring\cli\commands.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
_print_typo_summary ¶
_print_typo_summary(
result: TypoGenerationResult, *, output: TextIO
) -> None
Print the stable summary fields of a typo-generation result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
TypoGenerationResult
|
Typo-generation result returned by the pipeline. |
required |
output
|
TextIO
|
Destination stream. |
required |
Source code in hotstring\cli\commands.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
_print_autocorrect2_summary ¶
_print_autocorrect2_summary(
result: AutoCorrect2CheckResult, *, output: TextIO
) -> None
Print the stable summary fields of an AutoCorrect2 check result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
AutoCorrect2CheckResult
|
AutoCorrect2 result returned by the pipeline. |
required |
output
|
TextIO
|
Destination stream. |
required |
Source code in hotstring\cli\commands.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
_print_write_destination ¶
Print the generated-file destination when writing was enabled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
write_accepted
|
bool
|
Whether the selected command enabled writing. |
required |
project_dir
|
Path
|
AutoCorrect2 project directory. |
required |
output
|
TextIO
|
Destination stream. |
required |
Source code in hotstring\cli\commands.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
_print_report_path ¶
Print the report destination when one was requested.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report_path
|
Path | None
|
Optional report destination. |
required |
output
|
TextIO
|
Destination stream. |
required |
Source code in hotstring\cli\commands.py
166 167 168 169 170 171 172 173 174 175 176 | |