From 4b7f5df1ee477045eee29799d9cac7331be4c119 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Wed, 10 Jan 2024 14:01:58 -0500 Subject: [PATCH] cli lint (438) --- cmd/zrok/copy.go | 7 ++++--- cmd/zrok/davtest.go | 50 --------------------------------------------- 2 files changed, 4 insertions(+), 53 deletions(-) delete mode 100644 cmd/zrok/davtest.go diff --git a/cmd/zrok/copy.go b/cmd/zrok/copy.go index c2c59b04..27c3f22e 100644 --- a/cmd/zrok/copy.go +++ b/cmd/zrok/copy.go @@ -21,9 +21,10 @@ type copyCommand struct { func newCopyCommand() *copyCommand { cmd := &cobra.Command{ - Use: "copy [] ( defaults to 'file://.`)", - Short: "Copy (unidirectional sync) zrok drive contents from to ('http://', 'file://', and 'zrok://' supported)", - Args: cobra.RangeArgs(1, 2), + Use: "copy [] ( defaults to 'file://.`)", + Short: "Copy (unidirectional sync) zrok drive contents from to ('http://', 'file://', and 'zrok://' supported)", + Aliases: []string{"cp"}, + Args: cobra.RangeArgs(1, 2), } command := ©Command{cmd: cmd} cmd.Run = command.run diff --git a/cmd/zrok/davtest.go b/cmd/zrok/davtest.go deleted file mode 100644 index 20bffb35..00000000 --- a/cmd/zrok/davtest.go +++ /dev/null @@ -1,50 +0,0 @@ -package main - -import ( - "context" - "github.com/openziti/zrok/drives/davClient" - "github.com/spf13/cobra" - "io" - "net/http" - "os" -) - -func init() { - rootCmd.AddCommand(newDavtestCommand().cmd) -} - -type davtestCommand struct { - cmd *cobra.Command -} - -func newDavtestCommand() *davtestCommand { - cmd := &cobra.Command{ - Use: "davtest", - Short: "WebDAV testing wrapper", - Args: cobra.ExactArgs(3), - } - command := &davtestCommand{cmd: cmd} - cmd.Run = command.run - return command -} - -func (cmd *davtestCommand) run(_ *cobra.Command, args []string) { - client, err := davClient.NewClient(http.DefaultClient, args[0]) - if err != nil { - panic(err) - } - ws, err := client.Open(context.Background(), args[1]) - if err != nil { - panic(err) - } - fs, err := os.Create(args[2]) - if err != nil { - panic(err) - } - _, err = io.Copy(fs, ws) - if err != nil { - panic(err) - } - ws.Close() - fs.Close() -}