pass_typer: Match just server part of user@server for aliases

This commit is contained in:
Adam Goldsmith 2022-03-24 18:39:51 -04:00
parent 196b9802ad
commit ba2521bec2

View File

@ -15,11 +15,11 @@ cmd = partial(subprocess.run, capture_output=True, encoding="ascii")
def alias(server_name):
match server_name:
case "salt":
return "cms-net-svcs"
case "iPad1" | "iPad2" | "iPad3":
return "ipads"
match server_name.rpartition("@"):
case [_, _, "salt"]:
return 'cms/*cms-net-svcs'
case [_, _, ("iPad1" | "iPad2" | "iPad3")]:
return 'cms/*ipads'
case _:
return server_name