Add a clean subcommand
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
このコミットが含まれているのは:
コミット
07d4e12568
2
aya.1
2
aya.1
|
@ -19,6 +19,8 @@ Does it need one?
|
||||||
.Bl -tag
|
.Bl -tag
|
||||||
.It build
|
.It build
|
||||||
(Re-)build a site or a file in particular
|
(Re-)build a site or a file in particular
|
||||||
|
.It clean
|
||||||
|
Removes the generated site directory
|
||||||
.It serve
|
.It serve
|
||||||
Serve generated site over HTTP
|
Serve generated site over HTTP
|
||||||
.It var
|
.It var
|
||||||
|
|
|
@ -380,6 +380,7 @@ func printUsage() {
|
||||||
fmt.Printf("\n")
|
fmt.Printf("\n")
|
||||||
fmt.Printf("Where <command> is:\n")
|
fmt.Printf("Where <command> is:\n")
|
||||||
fmt.Printf("\tbuild\tGenerate site\n")
|
fmt.Printf("\tbuild\tGenerate site\n")
|
||||||
|
fmt.Printf("\tclean\tRemoves the generated site directory\n")
|
||||||
fmt.Printf("\tserve\tServe %v over HTTP\n", PUBDIR)
|
fmt.Printf("\tserve\tServe %v over HTTP\n", PUBDIR)
|
||||||
fmt.Printf("\tvar\tQuery variable(s) from a markdown file\n")
|
fmt.Printf("\tvar\tQuery variable(s) from a markdown file\n")
|
||||||
fmt.Printf("\tversion\tPrint program version and exit\n")
|
fmt.Printf("\tversion\tPrint program version and exit\n")
|
||||||
|
@ -406,6 +407,9 @@ func main() {
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("ERROR: too many arguments")
|
fmt.Println("ERROR: too many arguments")
|
||||||
}
|
}
|
||||||
|
case "clean":
|
||||||
|
fmt.Println("Removing generated site directory")
|
||||||
|
os.RemoveAll(PUBDIR)
|
||||||
case "serve":
|
case "serve":
|
||||||
servePubDir()
|
servePubDir()
|
||||||
case "var":
|
case "var":
|
||||||
|
|
読み込み中…
新しいイシューから参照