2018-02-07 19:02:18 +01:00
|
|
|
package app
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
2018-09-10 16:29:14 +02:00
|
|
|
"github.com/apex/log"
|
2021-02-02 10:32:46 +01:00
|
|
|
"github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/cli/root"
|
|
|
|
"github.com/ooni/probe-cli/v3/cmd/ooniprobe/internal/version"
|
2018-02-07 19:02:18 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// Run the app. This is the main app entry point
|
2018-09-10 16:29:14 +02:00
|
|
|
func Run() {
|
2019-05-23 16:38:46 +02:00
|
|
|
root.Cmd.Version(version.Version)
|
2018-02-07 19:02:18 +01:00
|
|
|
_, err := root.Cmd.Parse(os.Args[1:])
|
2018-09-10 16:29:14 +02:00
|
|
|
if err != nil {
|
2018-09-17 16:16:56 +02:00
|
|
|
log.WithError(err).Error("failure in main command")
|
2018-09-17 17:30:38 +02:00
|
|
|
os.Exit(2)
|
2018-09-10 16:29:14 +02:00
|
|
|
}
|
|
|
|
return
|
2018-02-07 19:02:18 +01:00
|
|
|
}
|