File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,7 @@ def print_cmd(cmd, super=""):
2626 p ["name" ],
2727 p ["type" ]["param_type" ] if p ["type" ]["param_type" ] != "Unprocessed" else "String" ,
2828 "yes" if p ["required" ] else "" ,
29- '"' + p ["default" ] + '"'
30- if p ["default" ] and p ["type" ]["param_type" ] == "String"
31- else Path (p ["default" ]).relative_to (Path .cwd ())
32- if p ["default" ] and p ["type" ]["param_type" ] == "Path"
33- else p ["default" ],
29+ format_default_value (p ["default" ], p ["type" ]["param_type" ]),
3430 ]
3531 for p in cmd ["params" ]
3632 if p ["name" ] != "help"
@@ -39,6 +35,16 @@ def print_cmd(cmd, super=""):
3935 doc += "\n \n "
4036
4137
38+ def format_default_value (default , param_type ):
39+ if default is None :
40+ return ""
41+ if param_type == "String" :
42+ return f'"{ default } "'
43+ if param_type == "Path" :
44+ return str (default )
45+ return default
46+
47+
4248with Context (cli ) as ctx :
4349 info = ctx .to_info_dict ()
4450 # root-level commands first
You can’t perform that action at this time.
0 commit comments