File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
snakemake_interface_common/plugin_registry Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -155,15 +155,23 @@ def register_cli_args(self, argparser):
155
155
settings .add_argument (* args , ** kwargs )
156
156
157
157
def validate_settings (self , settings ):
158
+ def get_description (thefield ):
159
+ envvar = (
160
+ f" (or environment variable { self .get_envvar (thefield .name )} )"
161
+ if thefield .metadata .get ("env_var" , None )
162
+ else ""
163
+ )
164
+ return f"{ self .get_cli_arg (thefield .name )} { envvar } "
165
+
158
166
# rewrite for settings
159
167
missing = [
160
- thefield . name
168
+ thefield
161
169
for thefield in fields (settings )
162
170
if thefield .metadata .get ("required" )
163
171
and getattr (settings , thefield .name ) is None
164
172
]
165
173
if missing :
166
- cli_args = [self . get_cli_arg ( name ) for name in missing ]
174
+ cli_args = [get_description ( thefield ) for thefield in missing ]
167
175
raise WorkflowError (
168
176
f"The following required arguments are missing for "
169
177
f"plugin { self .name } : { ', ' .join (cli_args )} ."
You can’t perform that action at this time.
0 commit comments