Skip to content

Commit

Permalink
starting on 'zrok copy from' (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Nov 8, 2023
1 parent 6e16a85 commit 3aea884
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
29 changes: 29 additions & 0 deletions cmd/zrok/copyFrom.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package main

import (
"github.com/io-developer/go-davsync/pkg/client/webdav"
"github.com/spf13/cobra"
)

func init() {
copyCmd.AddCommand(newCopyFromCommand().cmd)
}

type copyFromCommand struct {
cmd *cobra.Command
}

func newCopyFromCommand() *copyFromCommand {
cmd := &cobra.Command{
Use: "from <share> [<destination>]",
Short: "Copy files from zrok drive to destination",
Args: cobra.RangeArgs(1, 2),
}
command := &copyFromCommand{cmd: cmd}
cmd.Run = command.run
return command
}

func (cmd *copyFromCommand) run(_ *cobra.Command, args []string) {
_ = &webdav.Options{}
}
6 changes: 6 additions & 0 deletions cmd/zrok/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func init() {
testCmd.AddCommand(loopCmd)
rootCmd.AddCommand(adminCmd)
rootCmd.AddCommand(configCmd)
rootCmd.AddCommand(copyCmd)
rootCmd.AddCommand(shareCmd)
rootCmd.AddCommand(testCmd)
transport.AddAddressParser(tcp.AddressParser{})
Expand Down Expand Up @@ -79,6 +80,11 @@ var configCmd = &cobra.Command{
Short: "Configure your zrok environment",
}

var copyCmd = &cobra.Command{
Use: "copy",
Short: "Copy files to/from zrok drives",
}

var loopCmd = &cobra.Command{
Use: "loopback",
Aliases: []string{"loop"},
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ require (
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect
github.com/io-developer/go-davsync v1.0.1 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.14.0 // indirect
github.com/jackc/pgio v1.0.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,8 @@ github.com/influxdata/influxdb-client-go/v2 v2.11.0/go.mod h1:YteV91FiQxRdccyJ2c
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU=
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
github.com/io-developer/go-davsync v1.0.1 h1:TDwpE+O3saK4WlFL1K66W6fFWEQMfccGnDjyq9R9MpU=
github.com/io-developer/go-davsync v1.0.1/go.mod h1:s+hh2DEKAHJQjSZiLqoW2ahLw+lcvzRThHPOr1vfOw4=
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
Expand Down

0 comments on commit 3aea884

Please sign in to comment.