Coverage for docs_src/parameter_types/path/tutorial002_an.py: 100%
6 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 18:26 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 18:26 +0000
1from pathlib import Path 1habcdefg
3import typer 1habcdefg
4from typing_extensions import Annotated 1habcdefg
7def main( 1abcdefg
8 config: Annotated[
9 Path,
10 typer.Option(
11 exists=True,
12 file_okay=True,
13 dir_okay=False,
14 writable=False,
15 readable=True,
16 resolve_path=True,
17 ),
18 ],
19):
20 text = config.read_text() 1habcdefg
21 print(f"Config file contents: {text}") 1habcdefg
24if __name__ == "__main__": 1habcdefg
25 typer.run(main) 1habcdefg