77from somesy .commands import sync as sync_command
88from somesy .core .models import SomesyInput
99
10- from .util import resolved_somesy_input , wrap_exceptions
10+ from .util import (
11+ existing_file_arg_config ,
12+ file_arg_config ,
13+ resolved_somesy_input ,
14+ wrap_exceptions ,
15+ )
1116
1217logger = logging .getLogger ("somesy" )
1318
@@ -21,13 +26,8 @@ def sync(
2126 None ,
2227 "--input-file" ,
2328 "-i" ,
24- exists = False ,
25- file_okay = True ,
26- dir_okay = False ,
27- writable = True ,
28- readable = True ,
29- resolve_path = True ,
3029 help = "Somesy input file path (default: .somesy.toml)" ,
30+ ** file_arg_config ,
3131 ),
3232 no_sync_pyproject : bool = typer .Option (
3333 None ,
@@ -39,13 +39,8 @@ def sync(
3939 None ,
4040 "--pyproject-file" ,
4141 "-p" ,
42- exists = True ,
43- file_okay = True ,
44- dir_okay = False ,
45- writable = True ,
46- readable = True ,
47- resolve_path = True ,
4842 help = "Existing pyproject.toml file path (default: pyproject.toml)" ,
43+ ** existing_file_arg_config ,
4944 ),
5045 no_sync_package_json : bool = typer .Option (
5146 None ,
@@ -57,13 +52,34 @@ def sync(
5752 None ,
5853 "--package-json-file" ,
5954 "-j" ,
60- exists = True ,
61- file_okay = True ,
62- dir_okay = False ,
63- writable = True ,
64- readable = True ,
65- resolve_path = True ,
6655 help = "Existing package.json file path (default: package.json)" ,
56+ ** existing_file_arg_config ,
57+ ),
58+ no_sync_julia : bool = typer .Option (
59+ None ,
60+ "--no-sync-julia" ,
61+ "-L" ,
62+ help = "Do not sync Project.toml (Julia) file (default: False)" ,
63+ ),
64+ julia_file : Path = typer .Option (
65+ None ,
66+ "--julia-file" ,
67+ "-l" ,
68+ help = "Custom Project.toml (Julia) file path (default: Project.toml)" ,
69+ ** existing_file_arg_config ,
70+ ),
71+ no_sync_pom_xml : bool = typer .Option (
72+ None ,
73+ "--no-sync-pomxml" ,
74+ "-X" ,
75+ help = "Do not sync pom.xml (Java Maven) file (default: False)" ,
76+ ),
77+ pom_xml_file : Path = typer .Option (
78+ None ,
79+ "--pomxml-file" ,
80+ "-x" ,
81+ help = "Custom pom.xml (Java Maven) file path (default: pom.xml)" ,
82+ ** existing_file_arg_config ,
6783 ),
6884 no_sync_cff : bool = typer .Option (
6985 None ,
@@ -75,49 +91,21 @@ def sync(
7591 None ,
7692 "--cff-file" ,
7793 "-c" ,
78- exists = False ,
79- file_okay = True ,
80- dir_okay = False ,
81- writable = True ,
82- readable = True ,
83- resolve_path = True ,
8494 help = "CITATION.cff file path (default: CITATION.cff)" ,
95+ ** file_arg_config ,
8596 ),
8697 no_sync_codemeta : bool = typer .Option (
8798 None ,
8899 "--no-sync-codemeta" ,
89100 "-M" ,
90- help = "Do not sync codemeta.json file" ,
101+ help = "Do not sync codemeta.json file (default: False) " ,
91102 ),
92103 codemeta_file : Path = typer .Option (
93104 None ,
94105 "--codemeta-file" ,
95106 "-m" ,
96- exists = False ,
97- file_okay = True ,
98- dir_okay = False ,
99- writable = True ,
100- readable = True ,
101- resolve_path = True ,
102- help = "Custom codemeta.json file path" ,
103- ),
104- no_sync_julia : bool = typer .Option (
105- None ,
106- "--no-sync-julia" ,
107- "-M" ,
108- help = "Do not sync Project.toml(Julia) file" ,
109- ),
110- julia_file : Path = typer .Option (
111- None ,
112- "--julia-file" ,
113- "-m" ,
114- exists = True ,
115- file_okay = True ,
116- dir_okay = False ,
117- writable = True ,
118- readable = True ,
119- resolve_path = True ,
120- help = "Custom Project.toml(Julia) file path" ,
107+ help = "Custom codemeta.json file path (default: codemeta.json)" ,
108+ ** file_arg_config ,
121109 ),
122110):
123111 """Sync project metadata input with metadata files."""
@@ -133,6 +121,8 @@ def sync(
133121 codemeta_file = codemeta_file ,
134122 no_sync_julia = no_sync_julia ,
135123 julia_file = julia_file ,
124+ no_sync_pom_xml = no_sync_pom_xml ,
125+ pom_xml_file = pom_xml_file ,
136126 )
137127 run_sync (somesy_input )
138128
@@ -150,6 +140,14 @@ def run_sync(somesy_input: SomesyInput):
150140 logger .info (
151141 f" - [italic]package.json[/italic]:\t [grey]{ conf .package_json_file } [/grey]"
152142 )
143+ if not conf .no_sync_julia :
144+ logger .info (
145+ f" - [italic]Project.toml[/italic]:\t [grey]{ conf .julia_file } [/grey]\n "
146+ )
147+ if not conf .no_sync_pom_xml :
148+ logger .info (
149+ f" - [italic]pom.xml[/italic]:\t [grey]{ conf .pom_xml_file } [/grey]\n "
150+ )
153151 if not conf .no_sync_cff :
154152 logger .info (f" - [italic]CITATION.cff[/italic]:\t [grey]{ conf .cff_file } [/grey]" )
155153 if not conf .no_sync_codemeta :
0 commit comments