diff options
Diffstat (limited to 'cmd/vartan/root.go')
-rw-r--r-- | cmd/vartan/root.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cmd/vartan/root.go b/cmd/vartan/root.go new file mode 100644 index 0000000..ad163a6 --- /dev/null +++ b/cmd/vartan/root.go @@ -0,0 +1,28 @@ +package main + +import ( + "fmt" + "os" + + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: "vartan", + Short: "Generate a portable parsing table from a grammar", + Long: `vartan provides two features: +- Generates a portable parsing table from a grammar. +- Tokenizes a text stream according to the grammar. + This feature is primarily aimed at debugging the grammar.`, + SilenceErrors: true, + SilenceUsage: true, +} + +func Execute() error { + err := rootCmd.Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "%v\n", err) + return err + } + return nil +} |