mirror of
https://github.com/MontFerret/ferret.git
synced 2025-08-13 19:52:52 +02:00
Small change in CLI
This commit is contained in:
12
main.go
12
main.go
@@ -13,8 +13,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Version string
|
|
||||||
|
|
||||||
type Params []string
|
type Params []string
|
||||||
|
|
||||||
func (p *Params) String() string {
|
func (p *Params) String() string {
|
||||||
@@ -53,6 +51,8 @@ func (p *Params) ToMap() (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
version string
|
||||||
|
|
||||||
conn = flag.String(
|
conn = flag.String(
|
||||||
"cdp",
|
"cdp",
|
||||||
"http://0.0.0.0:9222",
|
"http://0.0.0.0:9222",
|
||||||
@@ -83,7 +83,7 @@ var (
|
|||||||
"show how much time was taken to execute a query",
|
"show how much time was taken to execute a query",
|
||||||
)
|
)
|
||||||
|
|
||||||
version = flag.Bool(
|
showVersion = flag.Bool(
|
||||||
"version",
|
"version",
|
||||||
false,
|
false,
|
||||||
"show REPL version",
|
"show REPL version",
|
||||||
@@ -113,8 +113,8 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if *version {
|
if *showVersion {
|
||||||
fmt.Println(Version)
|
fmt.Println(version)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -185,5 +185,5 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// nothing was passed, run REPL
|
// nothing was passed, run REPL
|
||||||
cli.Repl(Version, opts)
|
cli.Repl(version, opts)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user