File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,15 @@ def eb(ctx, other_args):
37
37
if value :
38
38
args .append (f"--{ key } " )
39
39
else :
40
+ if isinstance (value , (list , tuple )) and value :
41
+ # Flatten nested lists if necessary
42
+ if isinstance (value [0 ], list ):
43
+ value = sum (value , [])
44
+ # Match the type of the option with the default to see if we need to add it
45
+ if isinstance (value , list ) and isinstance (opt .default , tuple ):
46
+ value = tuple (value )
40
47
if value and value != opt .default :
41
- if isinstance (value , (list , tuple )) and value :
42
- if isinstance (value [0 ], list ):
43
- value = sum (value , [])
48
+ if isinstance (value , (list , tuple )):
44
49
if 'path' in opt .type :
45
50
delim = os .pathsep
46
51
elif 'str' in opt .type :
@@ -50,7 +55,8 @@ def eb(ctx, other_args):
50
55
else :
51
56
raise ValueError (f"Unsupported type for { key } : { opt .type } " )
52
57
value = delim .join (value )
53
- print (f"--Adding { key } ={ value } to args" )
58
+
59
+ # print(f"--Adding {key}={value} to args")
54
60
args .append (f"--{ key } ={ value } " )
55
61
56
62
args .extend (other_args )
You can’t perform that action at this time.
0 commit comments