mirror of
https://github.com/MontFerret/ferret.git
synced 2025-07-13 01:20:35 +02:00
Merge branch 'master' of github.com:MontFerret/ferret into master
This commit is contained in:
15
cli/exec.go
15
cli/exec.go
@ -3,12 +3,13 @@ package cli
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/MontFerret/ferret/pkg/compiler"
|
|
||||||
"github.com/MontFerret/ferret/pkg/runtime"
|
|
||||||
"github.com/MontFerret/ferret/pkg/runtime/logging"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
|
||||||
|
"github.com/MontFerret/ferret/pkg/compiler"
|
||||||
|
"github.com/MontFerret/ferret/pkg/runtime"
|
||||||
|
"github.com/MontFerret/ferret/pkg/runtime/logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ExecFile(pathToFile string, opts Options) {
|
func ExecFile(pathToFile string, opts Options) {
|
||||||
@ -29,8 +30,8 @@ func Exec(query string, opts Options) {
|
|||||||
prog, err := ferret.Compile(query)
|
prog, err := ferret.Compile(query)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed to compile the query")
|
fmt.Fprintln(os.Stderr, "Failed to compile the query")
|
||||||
fmt.Println(err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -70,8 +71,8 @@ func Exec(query string, opts Options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed to execute the query")
|
fmt.Fprintln(os.Stderr, "Failed to execute the query")
|
||||||
fmt.Println(err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user