| 1 | import arguably |
| 2 | |
| 3 | |
| 4 | @arguably.command |
| 5 | def ec2__start_instances(*instances): |
| 6 | """Start instances. |
| 7 | |
| 8 | Args: |
| 9 | *instances: {instance}s to start |
| 10 | """ |
| 11 | for inst in instances: |
| 12 | print(f"Starting {inst}") |
| 13 | |
| 14 | |
| 15 | @arguably.command |
| 16 | def ec2__stop_instances(*instances): |
| 17 | """Stop instances. |
| 18 | |
| 19 | Args: |
| 20 | *instances: {instance}s to stop |
| 21 | """ |
| 22 | for inst in instances: |
| 23 | print(f"Stopping {inst}") |
| 24 | |
| 25 | |
| 26 | if __name__ == "__main__": |
| 27 | arguably.run() |
| 28 | |
| 29 | from cyclopts import App |
| 30 | |
| 31 | app = App() |
| 32 | ec2 = app.command(App(name="ec2")) |
| 33 | |
| 34 | |
| 35 | @ec2.command |
| 36 | def start_instances(*instances): |
| 37 | """Start instances. |
| 38 | |
| 39 | Args: |
| 40 | *instances: {instance}s to start |
| 41 | """ |
| 42 | for inst in instances: |
| 43 | print(f"Starting {inst}") |
| 44 | |
| 45 | |
| 46 | @ec2.command |
| 47 | def stop_instances(*instances): |
| 48 | """Stop instances. |
| 49 | |
| 50 | Args: |
| 51 | *instances: {instance}s to stop |
| 52 | """ |
| 53 | for inst in instances: |
| 54 | print(f"Stopping {inst}") |
| 55 | |
| 56 | |
| 57 | if __name__ == "__main__": |
| 58 | app() |