|
2 | 2 |
|
3 | 3 | import logging |
4 | 4 | from pathlib import Path |
| 5 | +from typing import List, Optional |
5 | 6 |
|
6 | 7 | import typer |
7 | 8 |
|
|
23 | 24 | @app.callback(invoke_without_command=True) |
24 | 25 | @wrap_exceptions |
25 | 26 | def sync( |
26 | | - input_file: Path = typer.Option( |
| 27 | + input_file: Optional[Path] = typer.Option( |
27 | 28 | None, |
28 | 29 | "--input-file", |
29 | 30 | "-i", |
30 | 31 | help="Somesy input file path (default: .somesy.toml)", |
31 | 32 | **file_arg_config, |
32 | 33 | ), |
33 | | - no_sync_pyproject: bool = typer.Option( |
| 34 | + no_sync_pyproject: Optional[bool] = typer.Option( |
34 | 35 | None, |
35 | 36 | "--no-sync-pyproject", |
36 | 37 | "-P", |
37 | 38 | help="Do not sync pyproject.toml file (default: False)", |
38 | 39 | ), |
39 | | - pyproject_file: Path = typer.Option( |
| 40 | + pyproject_file: Optional[List[Path]] = typer.Option( |
40 | 41 | None, |
41 | 42 | "--pyproject-file", |
42 | 43 | "-p", |
43 | | - help="Existing pyproject.toml file path (default: pyproject.toml)", |
| 44 | + help="Existing pyproject.toml file path(s) (default: pyproject.toml)", |
44 | 45 | **existing_file_arg_config, |
45 | 46 | ), |
46 | | - no_sync_package_json: bool = typer.Option( |
| 47 | + no_sync_package_json: Optional[bool] = typer.Option( |
47 | 48 | None, |
48 | 49 | "--no-sync-package-json", |
49 | 50 | "-J", |
50 | 51 | help="Do not sync package.json file (default: False)", |
51 | 52 | ), |
52 | | - package_json_file: Path = typer.Option( |
| 53 | + package_json_file: Optional[List[Path]] = typer.Option( |
53 | 54 | None, |
54 | 55 | "--package-json-file", |
55 | 56 | "-j", |
56 | | - help="Existing package.json file path (default: package.json)", |
| 57 | + help="Existing package.json file path(s) (default: package.json)", |
57 | 58 | **existing_file_arg_config, |
58 | 59 | ), |
59 | | - no_sync_julia: bool = typer.Option( |
| 60 | + no_sync_julia: Optional[bool] = typer.Option( |
60 | 61 | None, |
61 | 62 | "--no-sync-julia", |
62 | 63 | "-L", |
63 | 64 | help="Do not sync Project.toml (Julia) file (default: False)", |
64 | 65 | ), |
65 | | - julia_file: Path = typer.Option( |
| 66 | + julia_file: Optional[List[Path]] = typer.Option( |
66 | 67 | None, |
67 | 68 | "--julia-file", |
68 | 69 | "-l", |
69 | | - help="Custom Project.toml (Julia) file path (default: Project.toml)", |
| 70 | + help="Custom Project.toml (Julia) file path(s) (default: Project.toml)", |
70 | 71 | **existing_file_arg_config, |
71 | 72 | ), |
72 | | - no_sync_fortran: bool = typer.Option( |
| 73 | + no_sync_fortran: Optional[bool] = typer.Option( |
73 | 74 | None, |
74 | 75 | "--no-sync-fortran", |
75 | 76 | "-F", |
76 | 77 | help="Do not sync fpm.toml (Fortran) file (default: False)", |
77 | | - **existing_file_arg_config, |
78 | 78 | ), |
79 | | - fortran_file: Path = typer.Option( |
| 79 | + fortran_file: Optional[List[Path]] = typer.Option( |
80 | 80 | None, |
81 | 81 | "--fortran-file", |
82 | 82 | "-f", |
83 | | - help="Custom fpm.toml (Fortran) file path (default: fpm.toml)", |
| 83 | + help="Custom fpm.toml (Fortran) file path(s) (default: fpm.toml)", |
| 84 | + **existing_file_arg_config, |
84 | 85 | ), |
85 | | - no_sync_pom_xml: bool = typer.Option( |
| 86 | + no_sync_pom_xml: Optional[bool] = typer.Option( |
86 | 87 | None, |
87 | 88 | "--no-sync-pomxml", |
88 | 89 | "-X", |
89 | 90 | help="Do not sync pom.xml (Java Maven) file (default: False)", |
90 | 91 | ), |
91 | | - pom_xml_file: Path = typer.Option( |
| 92 | + pom_xml_file: Optional[List[Path]] = typer.Option( |
92 | 93 | None, |
93 | 94 | "--pomxml-file", |
94 | 95 | "-x", |
95 | | - help="Custom pom.xml (Java Maven) file path (default: pom.xml)", |
| 96 | + help="Custom pom.xml (Java Maven) file path(s) (default: pom.xml)", |
96 | 97 | **existing_file_arg_config, |
97 | 98 | ), |
98 | | - no_sync_mkdocs: bool = typer.Option( |
| 99 | + no_sync_mkdocs: Optional[bool] = typer.Option( |
99 | 100 | None, |
100 | 101 | "--no-sync-mkdocs", |
101 | 102 | "-D", |
102 | 103 | help="Do not sync mkdocs.yml file (default: False)", |
103 | 104 | ), |
104 | | - mkdocs_file: Path = typer.Option( |
| 105 | + mkdocs_file: Optional[List[Path]] = typer.Option( |
105 | 106 | None, |
106 | 107 | "--mkdocs-file", |
107 | 108 | "-d", |
108 | | - help="Custom mkdocs.yml file path (default: mkdocs.yml)", |
| 109 | + help="Custom mkdocs.yml file path(s) (default: mkdocs.yml)", |
109 | 110 | **existing_file_arg_config, |
110 | 111 | ), |
111 | | - no_sync_rust: bool = typer.Option( |
| 112 | + no_sync_rust: Optional[bool] = typer.Option( |
112 | 113 | None, |
113 | 114 | "--no-sync-rust", |
114 | 115 | "-R", |
115 | 116 | help="Do not sync Cargo.toml file (default: False)", |
116 | 117 | ), |
117 | | - rust_file: Path = typer.Option( |
| 118 | + rust_file: Optional[List[Path]] = typer.Option( |
118 | 119 | None, |
119 | 120 | "--rust-file", |
120 | 121 | "-r", |
121 | | - help="Custom Cargo.toml file path (default: Cargo.toml)", |
| 122 | + help="Custom Cargo.toml file path(s) (default: Cargo.toml)", |
122 | 123 | **existing_file_arg_config, |
123 | 124 | ), |
124 | | - no_sync_cff: bool = typer.Option( |
| 125 | + no_sync_cff: Optional[bool] = typer.Option( |
125 | 126 | None, |
126 | 127 | "--no-sync-cff", |
127 | 128 | "-C", |
128 | 129 | help="Do not sync CITATION.cff file (default: False)", |
129 | 130 | ), |
130 | | - cff_file: Path = typer.Option( |
| 131 | + cff_file: Optional[List[Path]] = typer.Option( |
131 | 132 | None, |
132 | 133 | "--cff-file", |
133 | 134 | "-c", |
134 | | - help="CITATION.cff file path (default: CITATION.cff)", |
| 135 | + help="CITATION.cff file path(s) (default: CITATION.cff)", |
135 | 136 | **file_arg_config, |
136 | 137 | ), |
137 | | - no_sync_codemeta: bool = typer.Option( |
| 138 | + no_sync_codemeta: Optional[bool] = typer.Option( |
138 | 139 | None, |
139 | 140 | "--no-sync-codemeta", |
140 | 141 | "-M", |
141 | 142 | help="Do not sync codemeta.json file (default: False)", |
142 | 143 | ), |
143 | | - codemeta_file: Path = typer.Option( |
| 144 | + codemeta_file: Optional[List[Path]] = typer.Option( |
144 | 145 | None, |
145 | 146 | "--codemeta-file", |
146 | 147 | "-m", |
147 | | - help="Custom codemeta.json file path (default: codemeta.json)", |
| 148 | + help="Custom codemeta.json file path(s) (default: codemeta.json)", |
148 | 149 | **file_arg_config, |
149 | 150 | ), |
150 | | - merge_codemeta: bool = typer.Option( |
| 151 | + merge_codemeta: Optional[bool] = typer.Option( |
151 | 152 | False, |
152 | 153 | "--merge/--overwrite", |
153 | 154 | help="Merge codemeta.json with with an existing codemeta.json file (default: False)", |
154 | 155 | ), |
155 | | - pass_validation: bool = typer.Option( |
| 156 | + pass_validation: Optional[bool] = typer.Option( |
156 | 157 | False, |
157 | 158 | "--pass-validation", |
158 | 159 | "-P", |
|
0 commit comments