aboutsummaryrefslogtreecommitdiffstats
path: root/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'handlers.go')
-rw-r--r--handlers.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/handlers.go b/handlers.go
index a4bb3e2..426f089 100644
--- a/handlers.go
+++ b/handlers.go
@@ -32,6 +32,21 @@ func downloadHandler(ctx cli.Context) {
})
}
+func uploadHandler(ctx cli.Context) {
+ args := ctx.Args()
+ gdrive := newDrive()
+
+ gdrive.Upload(drive.UploadFileArgs{
+ Path: args.String("path"),
+ Name: args.String("name"),
+ Parent: args.String("parent"),
+ Mime: args.String("mime"),
+ Recursive: args.Bool("recursive"),
+ Stdin: args.Bool("stdin"),
+ Share: args.Bool("share"),
+ })
+}
+
func deleteHandler(ctx cli.Context) {
fmt.Println("Deleting...")
}
@@ -74,6 +89,7 @@ func printCommandHelp(ctx cli.Context) {
}
}
+// TODO: take app path as arg
func newDrive() *drive.Drive {
oauth, err := client.NewOauthClient(ClientId, ClientSecret, DefaultTokenFilePath, authCodePrompt)
if err != nil {