erynwells.me/scripts/erynwells_me/scripting/command.py

24 lines
629 B
Python

# Eryn Wells <eryn@erynwells.me>
import argparse
import re
class Command:
def __init__(self) -> None:
pass
@property
def name(self) -> str:
class_name = self.__class__.__name__
if class_name.endswith('Command'):
trimmed_class_name = class_name.removesuffix('Command')
hyphenated_name = re.sub(r'\B([A-Z])', r'-\1', trimmed_class_name)
return hyphenated_name.lower()
return class_name.lower()
@property
def help(self) -> str:
return ''
def add_arguments(self, _: argparse.ArgumentParser):
raise NotImplementedError()