aboutsummaryrefslogtreecommitdiffstats
path: root/gdrive.go
diff options
context:
space:
mode:
authorPetter Rasmussen2016-02-03 20:24:38 +0100
committerPetter Rasmussen2016-02-03 20:24:38 +0100
commit1131605c14244c575991999051649f04f2e9f8bd (patch)
tree089f7486c1c069eb2be1e2dab4eeffe86a233e19 /gdrive.go
parent1a83dbc57e1bd7481f6c716e7705a9712a726008 (diff)
downloadgdrive-1131605c14244c575991999051649f04f2e9f8bd.tar.bz2
Rename command to avoid overlap, change order
Diffstat (limited to 'gdrive.go')
-rw-r--r--gdrive.go404
1 files changed, 202 insertions, 202 deletions
diff --git a/gdrive.go b/gdrive.go
index 19cbdf0..ba8e53a 100644
--- a/gdrive.go
+++ b/gdrive.go
@@ -76,74 +76,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] <id>",
- 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] <id>",
Description: "Download file or directory",
Callback: downloadHandler,
@@ -183,56 +115,6 @@ func main() {
},
},
&cli.Handler{
- Pattern: "[global] download sync [options] <id> <path>",
- 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] <fileId> <revisionId>",
- 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] <path>",
Description: "Upload file or directory",
Callback: uploadHandler,
@@ -282,7 +164,7 @@ func main() {
},
},
&cli.Handler{
- Pattern: "[global] upload stdin [options] <name>",
+ Pattern: "[global] upload - [options] <name>",
Description: "Upload file from stdin",
Callback: uploadStdinHandler,
Flags: cli.Flags{
@@ -314,34 +196,6 @@ func main() {
},
},
&cli.Handler{
- Pattern: "[global] upload sync [options] <path> <id>",
- 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] <id> <path>",
Description: "Update file, this creates a new revision of the file",
Callback: updateHandler,
@@ -407,60 +261,6 @@ func main() {
},
},
&cli.Handler{
- Pattern: "[global] import [options] <path>",
- 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] <id>",
- 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] <name>",
Description: "Create directory",
Callback: mkdirHandler,
@@ -529,7 +329,153 @@ func main() {
},
},
&cli.Handler{
- Pattern: "[global] delete revision <fileId> <revisionId>",
+ Pattern: "[global] sync download [options] <id> <path>",
+ 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] <path> <id>",
+ 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] <id>",
+ 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] <fileId> <revisionId>",
+ 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 <fileId> <revisionId>",
Description: "Delete file revision",
Callback: deleteRevisionHandler,
Flags: cli.Flags{
@@ -537,6 +483,60 @@ func main() {
},
},
&cli.Handler{
+ Pattern: "[global] import [options] <path>",
+ 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] <id>",
+ 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",
Callback: aboutHandler,