spcd/cd/__main__.py
Marc Beninca 2d8c6320dc
All checks were successful
/ job (push) Successful in 7m22s
init,main
2024-06-09 23:15:19 +02:00

18 lines
403 B
Python
Executable file

#! /usr/bin/env python3
"""Entry point to either bootstrap or command."""
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)