From 29e1a644a888992dd8b1646565d8247597f18565 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 10 Dec 2024 11:10:30 -0300 Subject: cmd/: Simplify flag usage --- cmd/vartan/compile.go | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'cmd/vartan/compile.go') diff --git a/cmd/vartan/compile.go b/cmd/vartan/compile.go index 0755456..95a4c58 100644 --- a/cmd/vartan/compile.go +++ b/cmd/vartan/compile.go @@ -13,23 +13,7 @@ import ( "spec/grammar/parser" ) -var compileFlags = struct { - output *string -}{} - -/* -func init() { - cmd := &cobra.Command{ - Use: "compile", - Short: "Compile grammar you defined into a parsing table", - Example: ` vartan compile grammar.vartan -o grammar.json`, - Args: cobra.MaximumNArgs(1), - RunE: runCompile, - } - compileFlags.output = cmd.Flags().StringP("output", "o", "", "output file path (default stdout)") - rootCmd.AddCommand(cmd) -} -*/ + func runCompile(args []string) (retErr error) { var tmpDirPath string @@ -85,7 +69,7 @@ func runCompile(args []string) (retErr error) { return err } - err = writeCompiledGrammarAndReport(gram, report, *compileFlags.output) + err = writeCompiledGrammarAndReport(gram, report, "") if err != nil { return fmt.Errorf("Cannot write an output files: %w", err) } -- cgit v1.2.3