summaryrefslogtreecommitdiffstats
path: root/client/go/cmd/root.go
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2021-08-24 09:50:31 +0200
committerJon Bratseth <bratseth@gmail.com>2021-08-24 09:50:31 +0200
commit4478aeeb245a208c8e4a4c4c9d217136de03f609 (patch)
tree7802cf81a50c8c714b504b1d5611d619df50357f /client/go/cmd/root.go
parent89dac5ccb4b9fd1f34c28338b2ed01e87a80c630 (diff)
Move modules to root
Diffstat (limited to 'client/go/cmd/root.go')
-rw-r--r--client/go/cmd/root.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/client/go/cmd/root.go b/client/go/cmd/root.go
new file mode 100644
index 00000000000..8f33cb47c43
--- /dev/null
+++ b/client/go/cmd/root.go
@@ -0,0 +1,34 @@
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Root Cobra command: vespa
+// author: bratseth
+
+package cmd
+
+import (
+ "github.com/spf13/cobra"
+)
+
+var (
+ // flags
+ // TODO: add timeout flag
+ // TODO: add flag to show http request made
+ targetArgument string
+
+ rootCmd = &cobra.Command{
+ Use: "vespa",
+ Short: "A command-line tool for working with Vespa instances",
+ Long: `TO
+DO`,
+ }
+)
+
+func init() {
+ cobra.OnInitialize(readConfig)
+ rootCmd.PersistentFlags().StringVarP(&targetArgument, "target", "t", "local", "The name or URL of the recipient of this command")
+}
+
+// Execute executes the root command.
+func Execute() error {
+ err := rootCmd.Execute()
+ return err
+}