mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 18:04:55 +01:00
Regularize the command definition names
This commit is contained in:
parent
05798672c8
commit
5e35aeca9e
@ -7,10 +7,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(authorizeCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var authorizeCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "authorize",
|
Use: "authorize",
|
||||||
Short: `Remote authorization.`,
|
Short: `Remote authorization.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -9,10 +9,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(catCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var catCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "cat remote:path",
|
Use: "cat remote:path",
|
||||||
Short: `Concatenates any files and sends them to stdout.`,
|
Short: `Concatenates any files and sends them to stdout.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(checkCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var checkCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "check source:path dest:path",
|
Use: "check source:path dest:path",
|
||||||
Short: `Checks the files in the source and destination match.`,
|
Short: `Checks the files in the source and destination match.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(cleanupCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var cleanupCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "cleanup remote:path",
|
Use: "cleanup remote:path",
|
||||||
Short: `Clean up the remote if possible`,
|
Short: `Clean up the remote if possible`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(configCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var configCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "config",
|
Use: "config",
|
||||||
Short: `Enter an interactive configuration session.`,
|
Short: `Enter an interactive configuration session.`,
|
||||||
Run: func(command *cobra.Command, args []string) {
|
Run: func(command *cobra.Command, args []string) {
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(copyCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var copyCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "copy source:path dest:path",
|
Use: "copy source:path dest:path",
|
||||||
Short: `Copy files from source to dest, skipping already copied`,
|
Short: `Copy files from source to dest, skipping already copied`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -13,11 +13,11 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(dedupeCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
dedupeCmd.Flags().VarP(&dedupeMode, "dedupe-mode", "", "Dedupe mode interactive|skip|first|newest|oldest|rename.")
|
commandDefintion.Flags().VarP(&dedupeMode, "dedupe-mode", "", "Dedupe mode interactive|skip|first|newest|oldest|rename.")
|
||||||
}
|
}
|
||||||
|
|
||||||
var dedupeCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "dedupe [mode] remote:path",
|
Use: "dedupe [mode] remote:path",
|
||||||
Short: `Interactively find duplicate files delete/rename them.`,
|
Short: `Interactively find duplicate files delete/rename them.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(deleteCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var deleteCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "delete remote:path",
|
Use: "delete remote:path",
|
||||||
Short: `Remove the contents of path.`,
|
Short: `Remove the contents of path.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -8,10 +8,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(genautocompleteCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var genautocompleteCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "genautocomplete [output_file]",
|
Use: "genautocomplete [output_file]",
|
||||||
Short: `Output bash completion script for rclone.`,
|
Short: `Output bash completion script for rclone.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(gendocsCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
const gendocFrontmatterTemplate = `---
|
const gendocFrontmatterTemplate = `---
|
||||||
@ -25,7 +25,7 @@ url: %s
|
|||||||
---
|
---
|
||||||
`
|
`
|
||||||
|
|
||||||
var gendocsCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "gendocs output_directory",
|
Use: "gendocs output_directory",
|
||||||
Short: `Output markdown docs for rclone to the directory supplied.`,
|
Short: `Output markdown docs for rclone to the directory supplied.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -15,11 +15,11 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(listremotesCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
listremotesCmd.Flags().BoolVarP(&listLong, "long", "l", listLong, "Show the type as well as names.")
|
commandDefintion.Flags().BoolVarP(&listLong, "long", "l", listLong, "Show the type as well as names.")
|
||||||
}
|
}
|
||||||
|
|
||||||
var listremotesCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "listremotes",
|
Use: "listremotes",
|
||||||
Short: `List all the remotes in the config file.`,
|
Short: `List all the remotes in the config file.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -9,10 +9,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(lsCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var lsCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "ls remote:path",
|
Use: "ls remote:path",
|
||||||
Short: `List all the objects in the the path with size and path.`,
|
Short: `List all the objects in the the path with size and path.`,
|
||||||
Run: func(command *cobra.Command, args []string) {
|
Run: func(command *cobra.Command, args []string) {
|
||||||
|
@ -9,10 +9,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(lsdCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var lsdCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "lsd remote:path",
|
Use: "lsd remote:path",
|
||||||
Short: `List all directories/containers/buckets in the the path.`,
|
Short: `List all directories/containers/buckets in the the path.`,
|
||||||
Run: func(command *cobra.Command, args []string) {
|
Run: func(command *cobra.Command, args []string) {
|
||||||
|
@ -9,10 +9,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(lslCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var lslCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "lsl remote:path",
|
Use: "lsl remote:path",
|
||||||
Short: `List all the objects path with modification time, size and path.`,
|
Short: `List all the objects path with modification time, size and path.`,
|
||||||
Run: func(command *cobra.Command, args []string) {
|
Run: func(command *cobra.Command, args []string) {
|
||||||
|
@ -9,10 +9,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(md5sumCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var md5sumCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "md5sum remote:path",
|
Use: "md5sum remote:path",
|
||||||
Short: `Produces an md5sum file for all the objects in the path.`,
|
Short: `Produces an md5sum file for all the objects in the path.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -10,10 +10,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(memtestCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var memtestCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "memtest remote:path",
|
Use: "memtest remote:path",
|
||||||
Short: `Load all the objects at remote:path and report memory stats.`,
|
Short: `Load all the objects at remote:path and report memory stats.`,
|
||||||
Hidden: true,
|
Hidden: true,
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(mkdirCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var mkdirCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "mkdir remote:path",
|
Use: "mkdir remote:path",
|
||||||
Short: `Make the path if it doesn't already exist.`,
|
Short: `Make the path if it doesn't already exist.`,
|
||||||
Run: func(command *cobra.Command, args []string) {
|
Run: func(command *cobra.Command, args []string) {
|
||||||
|
@ -43,26 +43,26 @@ var (
|
|||||||
func init() {
|
func init() {
|
||||||
umask = unix.Umask(0) // read the umask
|
umask = unix.Umask(0) // read the umask
|
||||||
unix.Umask(umask) // set it back to what it was
|
unix.Umask(umask) // set it back to what it was
|
||||||
cmd.Root.AddCommand(mountCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
mountCmd.Flags().BoolVarP(&noModTime, "no-modtime", "", noModTime, "Don't read the modification time (can speed things up).")
|
commandDefintion.Flags().BoolVarP(&noModTime, "no-modtime", "", noModTime, "Don't read the modification time (can speed things up).")
|
||||||
mountCmd.Flags().BoolVarP(&debugFUSE, "debug-fuse", "", debugFUSE, "Debug the FUSE internals - needs -v.")
|
commandDefintion.Flags().BoolVarP(&debugFUSE, "debug-fuse", "", debugFUSE, "Debug the FUSE internals - needs -v.")
|
||||||
mountCmd.Flags().BoolVarP(&noSeek, "no-seek", "", noSeek, "Don't allow seeking in files.")
|
commandDefintion.Flags().BoolVarP(&noSeek, "no-seek", "", noSeek, "Don't allow seeking in files.")
|
||||||
mountCmd.Flags().DurationVarP(&dirCacheTime, "dir-cache-time", "", dirCacheTime, "Time to cache directory entries for.")
|
commandDefintion.Flags().DurationVarP(&dirCacheTime, "dir-cache-time", "", dirCacheTime, "Time to cache directory entries for.")
|
||||||
// mount options
|
// mount options
|
||||||
mountCmd.Flags().BoolVarP(&readOnly, "read-only", "", readOnly, "Mount read-only.")
|
commandDefintion.Flags().BoolVarP(&readOnly, "read-only", "", readOnly, "Mount read-only.")
|
||||||
mountCmd.Flags().BoolVarP(&allowNonEmpty, "allow-non-empty", "", allowNonEmpty, "Allow mounting over a non-empty directory.")
|
commandDefintion.Flags().BoolVarP(&allowNonEmpty, "allow-non-empty", "", allowNonEmpty, "Allow mounting over a non-empty directory.")
|
||||||
mountCmd.Flags().BoolVarP(&allowRoot, "allow-root", "", allowRoot, "Allow access to root user.")
|
commandDefintion.Flags().BoolVarP(&allowRoot, "allow-root", "", allowRoot, "Allow access to root user.")
|
||||||
mountCmd.Flags().BoolVarP(&allowOther, "allow-other", "", allowOther, "Allow access to other users.")
|
commandDefintion.Flags().BoolVarP(&allowOther, "allow-other", "", allowOther, "Allow access to other users.")
|
||||||
mountCmd.Flags().BoolVarP(&defaultPermissions, "default-permissions", "", defaultPermissions, "Makes kernel enforce access control based on the file mode.")
|
commandDefintion.Flags().BoolVarP(&defaultPermissions, "default-permissions", "", defaultPermissions, "Makes kernel enforce access control based on the file mode.")
|
||||||
mountCmd.Flags().BoolVarP(&writebackCache, "write-back-cache", "", writebackCache, "Makes kernel buffer writes before sending them to rclone. Without this, writethrough caching is used.")
|
commandDefintion.Flags().BoolVarP(&writebackCache, "write-back-cache", "", writebackCache, "Makes kernel buffer writes before sending them to rclone. Without this, writethrough caching is used.")
|
||||||
mountCmd.Flags().VarP(&maxReadAhead, "max-read-ahead", "", "The number of bytes that can be prefetched for sequential reads.")
|
commandDefintion.Flags().VarP(&maxReadAhead, "max-read-ahead", "", "The number of bytes that can be prefetched for sequential reads.")
|
||||||
mountCmd.Flags().IntVarP(&umask, "umask", "", umask, "Override the permission bits set by the filesystem.")
|
commandDefintion.Flags().IntVarP(&umask, "umask", "", umask, "Override the permission bits set by the filesystem.")
|
||||||
mountCmd.Flags().Uint32VarP(&uid, "uid", "", uid, "Override the uid field set by the filesystem.")
|
commandDefintion.Flags().Uint32VarP(&uid, "uid", "", uid, "Override the uid field set by the filesystem.")
|
||||||
mountCmd.Flags().Uint32VarP(&gid, "gid", "", gid, "Override the gid field set by the filesystem.")
|
commandDefintion.Flags().Uint32VarP(&gid, "gid", "", gid, "Override the gid field set by the filesystem.")
|
||||||
//mountCmd.Flags().BoolVarP(&foreground, "foreground", "", foreground, "Do not detach.")
|
//commandDefintion.Flags().BoolVarP(&foreground, "foreground", "", foreground, "Do not detach.")
|
||||||
}
|
}
|
||||||
|
|
||||||
var mountCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "mount remote:path /path/to/mountpoint",
|
Use: "mount remote:path /path/to/mountpoint",
|
||||||
Short: `Mount the remote as a mountpoint. **EXPERIMENTAL**`,
|
Short: `Mount the remote as a mountpoint. **EXPERIMENTAL**`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(moveCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var moveCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "move source:path dest:path",
|
Use: "move source:path dest:path",
|
||||||
Short: `Move files from source to dest.`,
|
Short: `Move files from source to dest.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(purgeCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var purgeCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "purge remote:path",
|
Use: "purge remote:path",
|
||||||
Short: `Remove the path and all of its contents.`,
|
Short: `Remove the path and all of its contents.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(rmdirCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var rmdirCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "rmdir remote:path",
|
Use: "rmdir remote:path",
|
||||||
Short: `Remove the path if empty.`,
|
Short: `Remove the path if empty.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -9,10 +9,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(sha1sumCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var sha1sumCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "sha1sum remote:path",
|
Use: "sha1sum remote:path",
|
||||||
Short: `Produces an sha1sum file for all the objects in the path.`,
|
Short: `Produces an sha1sum file for all the objects in the path.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -9,10 +9,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(sizeCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var sizeCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "size remote:path",
|
Use: "size remote:path",
|
||||||
Short: `Prints the total size and number of objects in remote:path.`,
|
Short: `Prints the total size and number of objects in remote:path.`,
|
||||||
Run: func(command *cobra.Command, args []string) {
|
Run: func(command *cobra.Command, args []string) {
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(syncCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var syncCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "sync source:path dest:path",
|
Use: "sync source:path dest:path",
|
||||||
Short: `Make source and dest identical, modifying destination only.`,
|
Short: `Make source and dest identical, modifying destination only.`,
|
||||||
Long: `
|
Long: `
|
||||||
|
@ -6,10 +6,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmd.Root.AddCommand(versionCmd)
|
cmd.Root.AddCommand(commandDefintion)
|
||||||
}
|
}
|
||||||
|
|
||||||
var versionCmd = &cobra.Command{
|
var commandDefintion = &cobra.Command{
|
||||||
Use: "version",
|
Use: "version",
|
||||||
Short: `Show the version number.`,
|
Short: `Show the version number.`,
|
||||||
Run: func(command *cobra.Command, args []string) {
|
Run: func(command *cobra.Command, args []string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user