@@ -119,7 +119,7 @@ def preinit(self) -> None:
119119 self .check_config ()
120120
121121 @property
122- def _default_base_config (self ) -> str :
122+ def base_config_path (self ) -> str :
123123 return f"pkg://{ self .module } /example-config.yaml"
124124
125125 def prepare_arg_parser (self ) -> None :
@@ -133,35 +133,24 @@ def prepare_arg_parser(self) -> None:
133133 metavar = "<path>" ,
134134 help = "the path to your config file" ,
135135 )
136- self .parser .add_argument (
137- "-b" ,
138- "--base-config" ,
139- type = str ,
140- default = self ._default_base_config ,
141- metavar = "<path>" ,
142- help = "the path to the example config (for automatic config updates)" ,
143- )
144136 self .parser .add_argument (
145137 "-n" , "--no-update" , action = "store_true" , help = "Don't save updated config to disk"
146138 )
147139
148140 def prepare_config (self ) -> None :
149141 """Pre-init lifecycle method. Extend this if you want to customize config loading."""
150- self .config = self .config_class (self .args .config , self .args . base_config )
142+ self .config = self .config_class (self .args .config , self .base_config_path )
151143 self .load_and_update_config ()
152144
153145 def load_and_update_config (self ) -> None :
154146 self .config .load ()
155147 try :
156148 self .config .update (save = not self .args .no_update )
157149 except BaseMissingError :
158- if self .args .base_config != self ._default_base_config :
159- print (f"Failed to read base config from { self .args .base_config } " )
160- else :
161- print (
162- "Failed to read base config from the default path "
163- f"({ self ._default_base_config } ). Maybe your installation is corrupted?"
164- )
150+ print (
151+ "Failed to read base config from the default path "
152+ f"({ self .base_config_path } ). Maybe your installation is corrupted?"
153+ )
165154 sys .exit (12 )
166155
167156 def check_config (self ) -> None :
0 commit comments