def alias(text: str, mode: api.modes.Mode) -> str: """Replace alias with the actual command. Returns: The replaced text if text was an alias else text. """ cmd = text.split()[0] if cmd in aliases.get(mode): text = text.replace(cmd, aliases.get(mode)[cmd]) return wildcards.expand_internal(text, mode) return text
def print_output() -> None: print(wildcards.expand_internal(args.output, api.modes.current()))
def update_part(text: str) -> str: """Update aliases and % in final parts without separator.""" if SEPARATOR in text: return text return wildcards.expand_internal(alias(text.strip(), mode), mode)