spcd/cd/__main__.py
2024-06-09 20:28:09 +02:00

16 lines
352 B
Python
Executable file

#! /usr/bin/env python3
import sys
from pathlib import Path
import cd
if __name__ == "__main__":
path, *arguments = sys.argv
name = Path(path).name
if name == "__main__.py":
cd.set_ssh(*arguments)
cd.install_commands(__file__)
else:
function = getattr(cd, name.replace("-", "_"))
function(*arguments)