owl-blogs/cmd/owl/main.go

33 lines
537 B
Go
Raw Permalink Normal View History

2022-09-05 18:34:24 +00:00
package main
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
var repoPath string
var rootCmd = &cobra.Command{
Use: "owl",
Short: "Owl Blogs is a not so static blog generator",
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
func init() {
rootCmd.PersistentFlags().StringVar(&repoPath, "repo", ".", "Path to the repository to use.")
2022-09-05 19:14:15 +00:00
rootCmd.PersistentFlags().StringVar(&user, "user", "", "Username. Required for some commands.")
2022-09-05 18:34:24 +00:00
}
func main() {
Execute()
}