|
6 | 6 | import pooch |
7 | 7 | import typer |
8 | 8 | from loguru import logger |
| 9 | +from typing_extensions import Annotated |
9 | 10 |
|
10 | 11 | from mitreattack import release_info |
11 | 12 |
|
@@ -191,20 +192,22 @@ def _validate_versions(versions: List[str], stix20: bool, stix21: bool): |
191 | 192 |
|
192 | 193 | @app.command() |
193 | 194 | def download_attack_stix( |
194 | | - download_dir: str = typer.Option( |
195 | | - "attack-releases", "--download-dir", "-d", help="Folder to save downloaded STIX data." |
196 | | - ), |
197 | | - all_versions: bool = typer.Option( |
198 | | - False, "--all", "-a", help="Download all ATT&CK releases. Mutually exclusive with --version." |
199 | | - ), |
200 | | - attack_versions: Optional[List[str]] = typer.Option( |
201 | | - None, |
202 | | - "--version", |
203 | | - "-v", |
204 | | - help="Download specific ATT&CK version(s). Can be specified multiple times. Mutually exclusive with --all.", |
205 | | - ), |
206 | | - stix20: bool = typer.Option(True, help="Download STIX 2.0 data."), |
207 | | - stix21: bool = typer.Option(False, help="Download STIX 2.1 data."), |
| 195 | + download_dir: Annotated[ |
| 196 | + str, typer.Option("--download-dir", "-d", help="Folder to save downloaded STIX data.") |
| 197 | + ] = "attack-releases", |
| 198 | + all_versions: Annotated[ |
| 199 | + bool, typer.Option("--all", "-a", help="Download all ATT&CK releases. Mutually exclusive with --version.") |
| 200 | + ] = False, |
| 201 | + attack_versions: Annotated[ |
| 202 | + Optional[List[str]], |
| 203 | + typer.Option( |
| 204 | + "--version", |
| 205 | + "-v", |
| 206 | + help="Download specific ATT&CK version(s). Can be specified multiple times. Mutually exclusive with --all.", |
| 207 | + ), |
| 208 | + ] = None, |
| 209 | + stix20: Annotated[bool, typer.Option(help="Download STIX 2.0 data.")] = True, |
| 210 | + stix21: Annotated[bool, typer.Option(help="Download STIX 2.1 data.")] = False, |
208 | 211 | ): |
209 | 212 | """Download the ATT&CK STIX data from GitHub in JSON format. |
210 | 213 |
|
|
0 commit comments