1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
package cmd
import (
"os"
"github.com/psanford/wormhole-william/version"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "wormhole-william",
Short: "Create a wormhole and transfer files through it.",
Version: version.AgentVersion,
Long: `Create a (magic) Wormhole and communicate through it.
Wormholes are created by speaking the same magic CODE in two different
places at the same time. Wormholes are secure against anyone who doesn't
use the same code.`,
}
var (
relayURL string
verify bool
hideProgressBar bool
)
func Execute() error {
rootCmd.PersistentFlags().StringVar(&relayURL, "relay-url", "", "rendezvous relay to use")
if relayURL == "" {
relayURL = os.Getenv("WORMHOLE_RELAY_URL")
}
rootCmd.AddCommand(recvCommand())
rootCmd.AddCommand(sendCommand())
rootCmd.AddCommand(completionCommand())
return rootCmd.Execute()
}
|