Index: /trunk/Makefile
===================================================================
--- /trunk/Makefile	(revision 2)
+++ /trunk/Makefile	(revision 2)
@@ -0,0 +1,19 @@
+PREFIX ?= /usr/local
+GOFLAGS ?= -v -ldflags "-w -X `go list`.Version=${VERSION} -X `go list`.Commit=${COMMIT} -X `go list`.Build=${BUILD}" -tags "static_build"
+
+VERSION ?= `git describe --abbrev=0 --tags || echo $VERSION`
+COMMIT ?= `git rev-parse --short HEAD || echo $COMMIT`
+BUILD ?= `git show -s --pretty=format:%cI`
+
+all: yuuka
+
+yuuka:
+	go build ${GOFLAGS}
+	strip -s yuuka
+clean:
+	rm -f yuuka
+install:
+	install -Dm0755 yuuka ${DESTDIR}${PREFIX}/bin/yuuka
+uninstall:
+	rm -f ${DESTDIR}${PREFIX}/bin/yuuka
+
Index: /trunk/go.mod
===================================================================
--- /trunk/go.mod	(revision 1)
+++ /trunk/go.mod	(revision 2)
@@ -2,2 +2,4 @@
 
 go 1.20
+
+require github.com/integrii/flaggy v1.5.2
Index: /trunk/go.sum
===================================================================
--- /trunk/go.sum	(revision 2)
+++ /trunk/go.sum	(revision 2)
@@ -0,0 +1,5 @@
+github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
+github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/integrii/flaggy v1.5.2 h1:bWV20MQEngo4hWhno3i5Z9ISPxLPKj9NOGNwTWb/8IQ=
+github.com/integrii/flaggy v1.5.2/go.mod h1:dO13u7SYuhk910nayCJ+s1DeAAGC1THCMj1uSFmwtQ8=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Index: /trunk/main.go
===================================================================
--- /trunk/main.go	(revision 1)
+++ /trunk/main.go	(revision 2)
@@ -1,3 +1,3 @@
-// $TheSupernovaDuo: yuuka,v master 2023/5/29 17:54:15 yakumo_izuru Exp $
+// $TheSupernovaDuo: yuuka,v 0.1.1 2023/5/29 18:19:14 yakumo_izuru Exp $
 package main
 
@@ -7,32 +7,41 @@
 	"log"
 	"net/http"
-	"os"
+
+	"github.com/integrii/flaggy"
 )
 var (
-	format = "?AT"
-	url = "https://wttr.in"
+	format string = "AT"
+	region string
 )
 func main() {
-	if len(os.Args) == 1 {
-		PrintUsage()
-	}
+	flaggy.SetDescription("Yuuka is a wttr.in client")
+	flaggy.SetVersion(FullVersion())
+	
+	forecastCmd := flaggy.NewSubcommand("forecast")
+	forecastCmd.String(&format, "f", "format", "View options")
+	forecastCmd.String(&region, "r", "region", "Where to look at")
+	forecastCmd.Description = "Check the forecast for a specified location"
 
-	cmd := os.Args[1]
+	flaggy.AttachSubcommand(forecastCmd, 1)
 
-	switch cmd {
-	case "forecast":
-		ShowForecast()
-	case "moon":
-		ShowMoonPhases()
+	moonCmd := flaggy.NewSubcommand("moon")
+	moonCmd.String(&format, "f", "format", "View options")
+	moonCmd.Description = "Check the Moon's phases"
+
+	flaggy.AttachSubcommand(moonCmd, 1)
+
+	flaggy.ShowHelpOnUnexpectedDisable()
+	flaggy.Parse()
+
+	if forecastCmd.Used {
+		ShowForecast(region, format)
+	} else if moonCmd.Used {
+		ShowMoonPhases(format)
+	} else {
+		flaggy.ShowHelpAndExit("A subcommand is required")
 	}
 }
-func PrintUsage() {
-	fmt.Println("Yuuka is a wttr.in client")
-	fmt.Printf("\tforecast\tShow the current weather report according to your region\n")
-	fmt.Printf("\tmoon\tShow the current phase of the Moon\n")
-}
-	
-func ShowForecast() {
-	query := url + format
+func ShowForecast(region string, format string) {
+	query := "https://wttr.in/" + region + "?" + format
 	resp, err := http.Get(query)
 	sanityCheck(err)
@@ -42,6 +51,6 @@
 	fmt.Printf("%s", body)
 }
-func ShowMoonPhases() {
-	query := url + "/Moon" + format
+func ShowMoonPhases(format string) {
+	query := "https://wttr.in/" + "moon" + "?" + format
 	resp, err := http.Get(query)
 	sanityCheck(err)
Index: /trunk/version.go
===================================================================
--- /trunk/version.go	(revision 2)
+++ /trunk/version.go	(revision 2)
@@ -0,0 +1,19 @@
+// $TheSupernovaDuo: yuuka,v 0.1.1 2023/5/29 18:19:14 yakumo_izuru Exp $
+package main
+
+import (
+	"fmt"
+)
+
+var (
+	// Version release version
+	Version = "0.0.1"
+
+	// Commit will be overwritten automatically by the build system
+	Commit = "HEAD"
+)
+
+// FullVersion display the full version and build
+func FullVersion() string {
+	return fmt.Sprintf("%s@%s", Version, Commit)
+}
