spcd/cd/__main__.py

19 lines
403 B
Python
Raw Normal View History

2024-04-26 21:10:58 +00:00
#! /usr/bin/env python3
2024-06-09 21:15:19 +00:00
"""Entry point to either bootstrap or command."""
2024-04-26 21:10:58 +00:00
import sys
2024-06-09 16:09:53 +00:00
from pathlib import Path
2024-04-26 21:10:58 +00:00
2024-04-26 19:58:35 +00:00
import cd
2024-06-08 21:56:21 +00:00
if __name__ == "__main__":
2024-06-09 18:28:09 +00:00
path, *arguments = sys.argv
name = Path(path).name
if name == "__main__.py":
2024-06-01 18:14:06 +00:00
cd.set_ssh(*arguments)
2024-04-26 21:24:46 +00:00
cd.install_commands(__file__)
else:
2024-06-09 18:28:09 +00:00
function = getattr(cd, name.replace("-", "_"))
2024-04-26 21:55:20 +00:00
function(*arguments)