From fad05559605054d189419492a620d8c581a2c87e Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Tue, 7 Jan 2025 17:38:35 -0600 Subject: [PATCH] add help text --- sssg/cli.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sssg/cli.py b/sssg/cli.py index e58e77e..8efd8e3 100644 --- a/sssg/cli.py +++ b/sssg/cli.py @@ -5,7 +5,10 @@ import sys import os def main(args=sys.argv): - command = args[1] + try: + command = args[1] + except IndexError: + command = "nonexistent" if command == "rebuild": cwd = os.getcwd() @@ -15,3 +18,16 @@ def main(args=sys.argv): os.execv('/bin/sh', ['/bin/sh', '.deploy']) elif command == "update": sssg.liveupdate.liveupdate() + else: + help_text = """ +sssg - the stupid static site generator + +usage: sssg [verb] + +verb: one of + rebuild -- rebuilds the static site into output/ + deploy -- executes the deploy script + update -- rebuild the static site upon any change +""" + + print(help_text)