aboutsummaryrefslogtreecommitdiff
path: root/cmd/vartan/root.go
blob: ad163a6b7bd8c18504ad6acb2edc78412647e91f (plain) (blame)
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
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
}