forked from PaloAltoNetworks/cobra-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcnbas.py
23 lines (18 loc) · 1.02 KB
/
cnbas.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import argparse
from core import main
def parse_arguments():
parser = argparse.ArgumentParser(description="Terminal-based option tool")
parser.add_argument("cloud_provider", choices=["aws", "azure", "gcp"], help="Cloud provider (aws, azure, gcp)")
parser.add_argument("action", choices=["launch", "status", "destroy"], help="Action to perform (launch, status, destroy)")
parser.add_argument("--simulation", action="store_true", help="Enable simulation mode")
parser.add_argument("--scenario", choices=["scenario-1", "scenario-2"], default="scenario-1", help="Scenario selection")
return parser.parse_args()
def main_function(cloud_provider, action, simulation, scenario):
# Call the main function from the imported module and pass the options
main.main(cloud_provider, action, simulation, scenario)
if __name__ == "__main__":
args = parse_arguments()
# Convert argparse Namespace to dictionary
options = vars(args)
# Call the main function with options
main_function(**options)