spcd/cd/__main__.py

17 lines
352 B
Python
Raw Normal View History

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