commit 78b6d33c17014a8f076040daedb30223b4b6427a
Author: David Voznyarskiy <davidv@no-reply@disroot.org>
Date: Tue Mar 24 23:51:45 2026 -0700
WIP error handling
Signed-off-by: David Voznyarskiy <davidv@no-reply@disroot.org>
diff --git a/shindex/shindex.go b/shindex/shindex.go
index 42832c8..7587e6f 100644
--- a/shindex/shindex.go
+++ b/shindex/shindex.go
@@ -14,8 +14,7 @@ func main() {
args := os.Args[1:]
if len(args) == 0 {
- fmt.Println("ERROR not enough arguments")
- printHelp()
+ printHelp(1)
os.Exit(1)
}
@@ -152,6 +151,12 @@ func detectLicense(repo string) string {
return "0"
}
-func printHelp() {
- fmt.Println("read source code for now")
+func printHelp(errorNum int) {
+ switch errorNum {
+ case 1:
+ fmt.Println("ERROR not enough arguments")
+ fmt.Println()
+ }
+ fmt.Println("Usage: shindex [repo_path...]")
+ fmt.Println("creates a static html page to display git repos")
}