commit 62091ed1735a14f89238f9c7668ff521755e1dc2
parent 8166938921985ac67e4362f342ce9356c91fe190
Author: Tyler Clark <tyler.clark@foxide.xyz>
Date: Fri, 2 Jan 2026 16:12:49 -0500
Adding Makefile and some validation that the files exist
Diffstat:
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
@@ -0,0 +1,8 @@
+ALL:
+ go build -o gengo main.go
+
+install:
+ echo "We aren't ready for that yet..."
+
+clean:
+ rm gengo
diff --git a/main.go b/main.go
@@ -19,13 +19,23 @@
package main
import (
- //"fmt" // For formatting some outputs
- "os" // File system and argument library
+ "fmt" // For formatting some outputs
+ "os" // File system and arguments
)
/* Release version */
const version = "pre-alpha"
+func ValidateFile(filename string) (int, error) {
+ _, err := os.Stat(filename)
+ if os.IsNotExist(err) {
+ fmt.Println("File does not exist")
+ } else {
+ fmt.Println("File exists.")
+ }
+
+}
+
func callHelp() {
println("One day this will be a useful help message")
}
@@ -41,7 +51,7 @@ func ArgParser (argument[] string) {
case "-v", "--version":
println("Version:", version)
default:
- println("Do something valid")
+ ValidateFile(argument[i])
}
}