Run a command and show the result.
(command: str, description: str)
| 163 | |
| 164 | |
| 165 | async def demonstrate_command(command: str, description: str): |
| 166 | """Run a command and show the result.""" |
| 167 | output.rule(f"[bold blue]{description}[/bold blue]") |
| 168 | output.print(f"[cyan]Command:[/cyan] {command}") |
| 169 | output.print() |
| 170 | |
| 171 | result = False |
| 172 | try: |
| 173 | # Execute the command |
| 174 | result = await handle_command(command) |
| 175 | |
| 176 | if result: |
| 177 | output.success("Command handled successfully") |
| 178 | else: |
| 179 | output.warning("Command not recognized") |
| 180 | |
| 181 | except Exception as e: |
| 182 | output.error(f"Error executing command: {e}") |
| 183 | |
| 184 | output.print() |
| 185 | return result |
| 186 | |
| 187 | |
| 188 | async def main(): |