From 1131605c14244c575991999051649f04f2e9f8bd Mon Sep 17 00:00:00 2001 From: Petter Rasmussen Date: Wed, 3 Feb 2016 20:24:38 +0100 Subject: Rename command to avoid overlap, change order --- gdrive.go | 404 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 202 insertions(+), 202 deletions(-) (limited to 'gdrive.go') diff --git a/gdrive.go b/gdrive.go index 19cbdf0..ba8e53a 100644 --- a/gdrive.go +++ b/gdrive.go @@ -75,74 +75,6 @@ func main() { }, }, }, - &cli.Handler{ - Pattern: "[global] list changes [options]", - Description: "List file changes", - Callback: listChangesHandler, - Flags: cli.Flags{ - "global": globalFlags, - "options": []cli.Flag{ - cli.IntFlag{ - Name: "maxChanges", - Patterns: []string{"-m", "--max"}, - Description: fmt.Sprintf("Max changes to list, default: %d", DefaultMaxChanges), - DefaultValue: DefaultMaxChanges, - }, - cli.StringFlag{ - Name: "pageToken", - Patterns: []string{"--since"}, - Description: fmt.Sprintf("Page token to start listing changes from"), - DefaultValue: "1", - }, - cli.BoolFlag{ - Name: "now", - Patterns: []string{"--now"}, - Description: fmt.Sprintf("Get latest page token"), - OmitValue: true, - }, - cli.IntFlag{ - Name: "nameWidth", - Patterns: []string{"--name-width"}, - Description: fmt.Sprintf("Width of name column, default: %d, minimum: 9, use 0 for full width", DefaultNameWidth), - DefaultValue: DefaultNameWidth, - }, - cli.BoolFlag{ - Name: "skipHeader", - Patterns: []string{"--no-header"}, - Description: "Dont print the header", - OmitValue: true, - }, - }, - }, - }, - &cli.Handler{ - Pattern: "[global] list revisions [options] ", - Description: "List file revisions", - Callback: listRevisionsHandler, - Flags: cli.Flags{ - "global": globalFlags, - "options": []cli.Flag{ - cli.IntFlag{ - Name: "nameWidth", - Patterns: []string{"--name-width"}, - Description: fmt.Sprintf("Width of name column, default: %d, minimum: 9, use 0 for full width", DefaultNameWidth), - DefaultValue: DefaultNameWidth, - }, - cli.BoolFlag{ - Name: "skipHeader", - Patterns: []string{"--no-header"}, - Description: "Dont print the header", - OmitValue: true, - }, - cli.BoolFlag{ - Name: "sizeInBytes", - Patterns: []string{"--bytes"}, - Description: "Size in bytes", - OmitValue: true, - }, - }, - }, - }, &cli.Handler{ Pattern: "[global] download [options] ", Description: "Download file or directory", @@ -182,56 +114,6 @@ func main() { }, }, }, - &cli.Handler{ - Pattern: "[global] download sync [options] ", - Description: "Sync drive directory to local directory", - Callback: downloadSyncHandler, - Flags: cli.Flags{ - "global": globalFlags, - "options": []cli.Flag{ - cli.BoolFlag{ - Name: "noProgress", - Patterns: []string{"--no-progress"}, - Description: "Hide progress", - OmitValue: true, - }, - cli.BoolFlag{ - Name: "deleteExtraneous", - Patterns: []string{"--delete-extraneous"}, - Description: "Delete extraneous local files", - OmitValue: true, - }, - }, - }, - }, - &cli.Handler{ - Pattern: "[global] download revision [options] ", - Description: "Download revision", - Callback: downloadRevisionHandler, - Flags: cli.Flags{ - "global": globalFlags, - "options": []cli.Flag{ - cli.BoolFlag{ - Name: "force", - Patterns: []string{"-f", "--force"}, - Description: "Overwrite existing file", - OmitValue: true, - }, - cli.BoolFlag{ - Name: "noProgress", - Patterns: []string{"--no-progress"}, - Description: "Hide progress", - OmitValue: true, - }, - cli.BoolFlag{ - Name: "stdout", - Patterns: []string{"--stdout"}, - Description: "Write file content to stdout", - OmitValue: true, - }, - }, - }, - }, &cli.Handler{ Pattern: "[global] upload [options] ", Description: "Upload file or directory", @@ -282,7 +164,7 @@ func main() { }, }, &cli.Handler{ - Pattern: "[global] upload stdin [options] ", + Pattern: "[global] upload - [options] ", Description: "Upload file from stdin", Callback: uploadStdinHandler, Flags: cli.Flags{ @@ -313,34 +195,6 @@ func main() { }, }, }, - &cli.Handler{ - Pattern: "[global] upload sync [options] ", - Description: "Sync local directory to drive", - Callback: uploadSyncHandler, - Flags: cli.Flags{ - "global": globalFlags, - "options": []cli.Flag{ - cli.BoolFlag{ - Name: "noProgress", - Patterns: []string{"--no-progress"}, - Description: "Hide progress", - OmitValue: true, - }, - cli.BoolFlag{ - Name: "deleteExtraneous", - Patterns: []string{"--delete-extraneous"}, - Description: "Delete extraneous remote files", - OmitValue: true, - }, - cli.IntFlag{ - Name: "chunksize", - Patterns: []string{"--chunksize"}, - Description: fmt.Sprintf("Set chunk size in bytes, default: %d", DefaultUploadChunkSize), - DefaultValue: DefaultUploadChunkSize, - }, - }, - }, - }, &cli.Handler{ Pattern: "[global] update [options] ", Description: "Update file, this creates a new revision of the file", @@ -406,60 +260,6 @@ func main() { }, }, }, - &cli.Handler{ - Pattern: "[global] import [options] ", - Description: "Upload and convert file to a google document, see 'about import' for available conversions", - Callback: importHandler, - Flags: cli.Flags{ - "global": globalFlags, - "options": []cli.Flag{ - cli.StringSliceFlag{ - Name: "parent", - Patterns: []string{"-p", "--parent"}, - Description: "Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents", - }, - cli.BoolFlag{ - Name: "noProgress", - Patterns: []string{"--no-progress"}, - Description: "Hide progress", - OmitValue: true, - }, - cli.BoolFlag{ - Name: "share", - Patterns: []string{"--share"}, - Description: "Share file", - OmitValue: true, - }, - }, - }, - }, - &cli.Handler{ - Pattern: "[global] export [options] ", - Description: "Export a google document", - Callback: exportHandler, - Flags: cli.Flags{ - "global": globalFlags, - "options": []cli.Flag{ - cli.BoolFlag{ - Name: "force", - Patterns: []string{"-f", "--force"}, - Description: "Overwrite existing file", - OmitValue: true, - }, - cli.StringFlag{ - Name: "mime", - Patterns: []string{"--mime"}, - Description: "Mime type of exported file", - }, - cli.BoolFlag{ - Name: "printMimes", - Patterns: []string{"--print-mimes"}, - Description: "Print available mime types for given file", - OmitValue: true, - }, - }, - }, - }, &cli.Handler{ Pattern: "[global] mkdir [options] ", Description: "Create directory", @@ -529,13 +329,213 @@ func main() { }, }, &cli.Handler{ - Pattern: "[global] delete revision ", + Pattern: "[global] sync download [options] ", + Description: "Sync drive directory to local directory", + Callback: downloadSyncHandler, + Flags: cli.Flags{ + "global": globalFlags, + "options": []cli.Flag{ + cli.BoolFlag{ + Name: "noProgress", + Patterns: []string{"--no-progress"}, + Description: "Hide progress", + OmitValue: true, + }, + cli.BoolFlag{ + Name: "deleteExtraneous", + Patterns: []string{"--delete-extraneous"}, + Description: "Delete extraneous local files", + OmitValue: true, + }, + }, + }, + }, + &cli.Handler{ + Pattern: "[global] sync upload [options] ", + Description: "Sync local directory to drive", + Callback: uploadSyncHandler, + Flags: cli.Flags{ + "global": globalFlags, + "options": []cli.Flag{ + cli.BoolFlag{ + Name: "noProgress", + Patterns: []string{"--no-progress"}, + Description: "Hide progress", + OmitValue: true, + }, + cli.BoolFlag{ + Name: "deleteExtraneous", + Patterns: []string{"--delete-extraneous"}, + Description: "Delete extraneous remote files", + OmitValue: true, + }, + cli.IntFlag{ + Name: "chunksize", + Patterns: []string{"--chunksize"}, + Description: fmt.Sprintf("Set chunk size in bytes, default: %d", DefaultUploadChunkSize), + DefaultValue: DefaultUploadChunkSize, + }, + }, + }, + }, + &cli.Handler{ + Pattern: "[global] changes [options]", + Description: "List file changes", + Callback: listChangesHandler, + Flags: cli.Flags{ + "global": globalFlags, + "options": []cli.Flag{ + cli.IntFlag{ + Name: "maxChanges", + Patterns: []string{"-m", "--max"}, + Description: fmt.Sprintf("Max changes to list, default: %d", DefaultMaxChanges), + DefaultValue: DefaultMaxChanges, + }, + cli.StringFlag{ + Name: "pageToken", + Patterns: []string{"--since"}, + Description: fmt.Sprintf("Page token to start listing changes from"), + DefaultValue: "1", + }, + cli.BoolFlag{ + Name: "now", + Patterns: []string{"--now"}, + Description: fmt.Sprintf("Get latest page token"), + OmitValue: true, + }, + cli.IntFlag{ + Name: "nameWidth", + Patterns: []string{"--name-width"}, + Description: fmt.Sprintf("Width of name column, default: %d, minimum: 9, use 0 for full width", DefaultNameWidth), + DefaultValue: DefaultNameWidth, + }, + cli.BoolFlag{ + Name: "skipHeader", + Patterns: []string{"--no-header"}, + Description: "Dont print the header", + OmitValue: true, + }, + }, + }, + }, + &cli.Handler{ + Pattern: "[global] revision list [options] ", + Description: "List file revisions", + Callback: listRevisionsHandler, + Flags: cli.Flags{ + "global": globalFlags, + "options": []cli.Flag{ + cli.IntFlag{ + Name: "nameWidth", + Patterns: []string{"--name-width"}, + Description: fmt.Sprintf("Width of name column, default: %d, minimum: 9, use 0 for full width", DefaultNameWidth), + DefaultValue: DefaultNameWidth, + }, + cli.BoolFlag{ + Name: "skipHeader", + Patterns: []string{"--no-header"}, + Description: "Dont print the header", + OmitValue: true, + }, + cli.BoolFlag{ + Name: "sizeInBytes", + Patterns: []string{"--bytes"}, + Description: "Size in bytes", + OmitValue: true, + }, + }, + }, + }, + &cli.Handler{ + Pattern: "[global] revision download [options] ", + Description: "Download revision", + Callback: downloadRevisionHandler, + Flags: cli.Flags{ + "global": globalFlags, + "options": []cli.Flag{ + cli.BoolFlag{ + Name: "force", + Patterns: []string{"-f", "--force"}, + Description: "Overwrite existing file", + OmitValue: true, + }, + cli.BoolFlag{ + Name: "noProgress", + Patterns: []string{"--no-progress"}, + Description: "Hide progress", + OmitValue: true, + }, + cli.BoolFlag{ + Name: "stdout", + Patterns: []string{"--stdout"}, + Description: "Write file content to stdout", + OmitValue: true, + }, + }, + }, + }, + &cli.Handler{ + Pattern: "[global] revision delete ", Description: "Delete file revision", Callback: deleteRevisionHandler, Flags: cli.Flags{ "global": globalFlags, }, }, + &cli.Handler{ + Pattern: "[global] import [options] ", + Description: "Upload and convert file to a google document, see 'about import' for available conversions", + Callback: importHandler, + Flags: cli.Flags{ + "global": globalFlags, + "options": []cli.Flag{ + cli.StringSliceFlag{ + Name: "parent", + Patterns: []string{"-p", "--parent"}, + Description: "Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents", + }, + cli.BoolFlag{ + Name: "noProgress", + Patterns: []string{"--no-progress"}, + Description: "Hide progress", + OmitValue: true, + }, + cli.BoolFlag{ + Name: "share", + Patterns: []string{"--share"}, + Description: "Share file", + OmitValue: true, + }, + }, + }, + }, + &cli.Handler{ + Pattern: "[global] export [options] ", + Description: "Export a google document", + Callback: exportHandler, + Flags: cli.Flags{ + "global": globalFlags, + "options": []cli.Flag{ + cli.BoolFlag{ + Name: "force", + Patterns: []string{"-f", "--force"}, + Description: "Overwrite existing file", + OmitValue: true, + }, + cli.StringFlag{ + Name: "mime", + Patterns: []string{"--mime"}, + Description: "Mime type of exported file", + }, + cli.BoolFlag{ + Name: "printMimes", + Patterns: []string{"--print-mimes"}, + Description: "Print available mime types for given file", + OmitValue: true, + }, + }, + }, + }, &cli.Handler{ Pattern: "[global] about [options]", Description: "Google drive metadata, quota usage", -- cgit v1.2.3