aboutsummaryrefslogtreecommitdiff
path: root/cmd/maleeni/root.go
blob: 41c30816e6a8e8c5862b1663b009fd3a6ede7bf7 (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:   "maleeni",
	Short: "Generate a portable DFA from a lexical specification",
	Long: `maleeni provides two features:
* Generates a portable DFA from a lexical specification.
* Tokenizes a text stream according to the lexical specification.
  This feature is primarily aimed at debugging the lexical specification.`,
	SilenceErrors: true,
	SilenceUsage:  true,
}

func Execute() error {
	err := rootCmd.Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "%v\n", err)
		return err
	}
	return nil
}