-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.go
More file actions
33 lines (27 loc) · 666 Bytes
/
main.go
File metadata and controls
33 lines (27 loc) · 666 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"flag"
"fmt"
"os"
"github.com/peterhellberg/hiro/hiro"
)
// Command line flags
var (
inputFn = flag.String("input", "blueprint.md", "Input file (.md)")
outputFn = flag.String("output", "index.html", "Output file (.html)")
templateFn = flag.String("template", "", "Iglo template file")
)
func main() {
// Command line usage information
flag.Usage = func() {
fmt.Fprintf(os.Stderr, "\nCommand line arguments:\n\n")
flag.PrintDefaults()
}
// Parse the command line flags
flag.Parse()
// Generate the output file
err := hiro.Generate(*inputFn, *outputFn, *templateFn)
if err != nil {
fmt.Println("Error:", err)
}
}