1717)
1818from rich .table import Table
1919
20+ from pombast .config ._settings import PombastConfig
2021from pombast .core ._filter import ComponentFilter
2122from pombast .maven ._bom import load_bom
2223from pombast .maven ._rules import RulesXML
5556 multiple = True ,
5657 help = "Additional remote Maven repository URL (repeatable). Optionally prefix with a name: name=URL." ,
5758)
59+ @click .option (
60+ "--config" ,
61+ type = click .Path (exists = True , path_type = Path ),
62+ default = None ,
63+ help = "Path to pombast.toml configuration file." ,
64+ )
5865@click .option (
5966 "--rules" ,
6067 default = None ,
@@ -130,6 +137,7 @@ def status_cmd(
130137 include : tuple [str , ...],
131138 exclude : tuple [str , ...],
132139 repository : tuple [str , ...],
140+ config : Path | None ,
133141 rules : str | None ,
134142 projects : str | None ,
135143 badges : str | None ,
@@ -153,6 +161,14 @@ def status_cmd(
153161 format = "%(levelname)s %(name)s: %(message)s" ,
154162 )
155163
164+ sc = PombastConfig .load_default (config ).status
165+ effective_rules = rules or (str (sc .rules ) if sc .rules else None )
166+ effective_projects = projects or (str (sc .projects ) if sc .projects else None )
167+ effective_badges = badges or (str (sc .badges ) if sc .badges else None )
168+ effective_timestamps = timestamps or (str (sc .timestamps ) if sc .timestamps else None )
169+ effective_html = html_path or sc .html
170+ effective_header = header or sc .header
171+ effective_footer = footer or sc .footer
156172 effective_max_age = 0 if refresh else max_age
157173
158174 console .print (f"[bold]BOM:[/bold] [cyan]{ bom } [/cyan]" )
@@ -174,15 +190,17 @@ def status_cmd(
174190 f"(use [bold]--refresh[/bold] to bypass)"
175191 )
176192
177- if rules :
178- console .print (f"Loading rules: [cyan]{ rules } [/cyan]" )
179- rules_xml = RulesXML .load (rules )
193+ if effective_rules :
194+ console .print (f"Loading rules: [cyan]{ effective_rules } [/cyan]" )
195+ rules_xml = RulesXML .load (effective_rules )
180196 else :
181197 rules_xml = RulesXML .empty ()
182198
183- proj_ov = load_kv_file (projects ) if projects else {}
184- badge_ov = load_kv_file (badges ) if badges else {}
185- vetting_ov = load_timestamps_file (timestamps ) if timestamps else {}
199+ proj_ov = load_kv_file (effective_projects ) if effective_projects else {}
200+ badge_ov = load_kv_file (effective_badges ) if effective_badges else {}
201+ vetting_ov = (
202+ load_timestamps_file (effective_timestamps ) if effective_timestamps else {}
203+ )
186204
187205 cf = ComponentFilter (includes = list (include ), excludes = list (exclude ))
188206 total = len (cf .filter (bom_data .components ))
@@ -226,18 +244,18 @@ def status_cmd(
226244 f"[dim]None { len (entries ) - cuts - bumps } [/dim]"
227245 )
228246
229- if html_path :
230- header_html = header .read_text () if header else ""
231- footer_html = footer .read_text () if footer else ""
232- html_path .write_text (
247+ if effective_html :
248+ header_html = effective_header .read_text () if effective_header else ""
249+ footer_html = effective_footer .read_text () if effective_footer else ""
250+ effective_html .write_text (
233251 generate_html (
234252 entries ,
235253 nexus_base = nexus_base or "" ,
236254 header_html = header_html ,
237255 footer_html = footer_html ,
238256 )
239257 )
240- console .print (f"HTML report written to: [cyan]{ html_path } [/cyan]" )
258+ console .print (f"HTML report written to: [cyan]{ effective_html } [/cyan]" )
241259
242260
243261def _print_status_table (entries : list [StatusEntry ]) -> None :
0 commit comments