Merge branch 'add_config_list'

main
Micke Nordin 2 weeks ago
commit 5ea14a1a38

@ -155,6 +155,7 @@ def run_config(
config_filename: str, config_filename: str,
context: Union[None, str] = None, context: Union[None, str] = None,
baseurl: Union[None, str] = None, baseurl: Union[None, str] = None,
list_config: bool = False,
username: Union[None, str] = None, username: Union[None, str] = None,
password: Union[None, str] = None, password: Union[None, str] = None,
current: Union[None, str] = None, current: Union[None, str] = None,
@ -179,6 +180,11 @@ def run_config(
config_filename = symlink config_filename = symlink
if found: if found:
return return
if list_config:
config_data = get_config(config_filename)
config_data.pop("password", None)
output(config_data)
return
if not baseurl: if not baseurl:
needed.append("baseurl") needed.append("baseurl")
if not username: if not username:
@ -493,6 +499,7 @@ def get_parser() -> dict:
configcmd.add_argument("-C", configcmd.add_argument("-C",
"--current", "--current",
action=argparse.BooleanOptionalAction) action=argparse.BooleanOptionalAction)
configcmd.add_argument("-l", "--list", action="store_true")
configcmd.add_argument("-p", "--password") configcmd.add_argument("-p", "--password")
configcmd.add_argument("-u", "--username") configcmd.add_argument("-u", "--username")
@ -637,6 +644,7 @@ def main() -> int:
args.context, args.context,
args.baseurl, args.baseurl,
args.username, args.username,
args.list,
args.password, args.password,
args.current, args.current,
) )

Loading…
Cancel
Save