cmd

package
v1.57.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 37 Imported by: 5

Documentation

Overview

Package cmd implements the rclone command

It is in a sub package so it's internals can be re-used elsewhere

Index

Constants

This section is empty.

Variables

View Source
var GeneratingDocs = false

GeneratingDocs is set by rclone gendocs to alter the format of the output suitable for the documentation.

View Source
var Root = &cobra.Command{
	Use:   "rclone",
	Short: "Show help for rclone commands, flags and backends.",
	Long: `
Rclone syncs files to and from cloud storage providers as well as
mounting them, listing them in lots of different ways.

See the home page (https://rclone.org/) for installation, usage,
documentation, changelog and configuration walkthroughs.

`,
	PersistentPostRun: func(cmd *cobra.Command, args []string) {
		fs.Debugf("rclone", "Version %q finishing with parameters %q", fs.Version, os.Args)
		atexit.Run()
	},
	BashCompletionFunction: bashCompletionFunc,
	DisableAutoGenTag:      true,
}

Root is the main rclone command

Functions

func AddBackendFlags

func AddBackendFlags()

AddBackendFlags creates flags for all the backend options

func CheckArgs

func CheckArgs(MinArgs, MaxArgs int, cmd *cobra.Command, args []string)

CheckArgs checks there are enough arguments and prints a message if not

func Main

func Main()

Main runs rclone interpreting flags and commands out of os.Args

func NewFsDir

func NewFsDir(args []string) fs.Fs

NewFsDir creates a new Fs from the arguments

The argument must point a directory

func NewFsDstFile

func NewFsDstFile(args []string) (fdst fs.Fs, dstFileName string)

NewFsDstFile creates a new dst fs with a destination file name from the arguments

func NewFsFile

func NewFsFile(remote string) (fs.Fs, string)

NewFsFile creates an Fs from a name but may point to a file.

It returns a string with the file name if points to a file otherwise "".

func NewFsSrc

func NewFsSrc(args []string) fs.Fs

NewFsSrc creates a new src fs from the arguments.

The source can be a file or a directory - if a file then it will limit the Fs to a single file.

func NewFsSrcDst

func NewFsSrcDst(args []string) (fs.Fs, fs.Fs)

NewFsSrcDst creates a new src and dst fs from the arguments

func NewFsSrcDstFiles

func NewFsSrcDstFiles(args []string) (fsrc fs.Fs, srcFileName string, fdst fs.Fs, dstFileName string)

NewFsSrcDstFiles creates a new src and dst fs from the arguments If src is a file then srcFileName and dstFileName will be non-empty

func NewFsSrcFileDst

func NewFsSrcFileDst(args []string) (fsrc fs.Fs, srcFileName string, fdst fs.Fs)

NewFsSrcFileDst creates a new src and dst fs from the arguments

The source may be a file, in which case the source Fs and file name is returned

func Run

func Run(Retry bool, showStats bool, cmd *cobra.Command, f func() error)

Run the function with stats and retries if required

func ShowStats

func ShowStats() bool

ShowStats returns true if the user added a `--stats` flag to the command line.

This is called by Run to override the default value of the showStats passed in.

func ShowVersion

func ShowVersion()

ShowVersion prints the version to stdout

func SigInfoHandler

func SigInfoHandler()

SigInfoHandler creates SigInfo handler

func StartStats

func StartStats() func()

StartStats prints the stats every statsInterval

It returns a func which should be called to stop the stats.

Types

This section is empty.

Directories

Path Synopsis
Package all imports all the commands
Package all imports all the commands
Package bisync implements bisync Copyright (c) 2017-2020 Chris Nelson Package bisync implements bisync Copyright (c) 2017-2020 Chris Nelson Package bisync implements bisync Copyright (c) 2017-2020 Chris Nelson Package bisync implements bisync Copyright (c) 2017-2020 Chris Nelson Contributions to original python version: Hildo G. Jr., e2t, kalemas, silenceleaf
Package bisync implements bisync Copyright (c) 2017-2020 Chris Nelson Package bisync implements bisync Copyright (c) 2017-2020 Chris Nelson Package bisync implements bisync Copyright (c) 2017-2020 Chris Nelson Package bisync implements bisync Copyright (c) 2017-2020 Chris Nelson Contributions to original python version: Hildo G. Jr., e2t, kalemas, silenceleaf
bilib
Package bilib provides common stuff for bisync and bisync_test Package bilib provides common stuff for bisync and bisync_test Here it's got local file/directory helpers (nice to have in lib/file) Package bilib provides common stuff for bisync and bisync_test
Package bilib provides common stuff for bisync and bisync_test Package bilib provides common stuff for bisync and bisync_test Here it's got local file/directory helpers (nice to have in lib/file) Package bilib provides common stuff for bisync and bisync_test
ls
scan
Package scan does concurrent scanning of an Fs building up a directory tree.
Package scan does concurrent scanning of an Fs building up a directory tree.
docker
Package docker serves a remote suitable for use with docker volume api
Package docker serves a remote suitable for use with docker volume api
ftp
httplib
Package httplib provides common functionality for http servers Deprecated: httplib has been replaced with lib/http
Package httplib provides common functionality for http servers Deprecated: httplib has been replaced with lib/http
proxy
Package proxy implements a programmable proxy for rclone serve
Package proxy implements a programmable proxy for rclone serve
proxy/proxyflags
Package proxyflags implements command line flags to set up a proxy
Package proxyflags implements command line flags to set up a proxy
servetest
Package servetest provides infrastructure for running loopback tests of "rclone serve backend:" against the backend integration tests.
Package servetest provides infrastructure for running loopback tests of "rclone serve backend:" against the backend integration tests.
webdav
Package webdav implements a WebDAV server backed by rclone VFS
Package webdav implements a WebDAV server backed by rclone VFS
changenotify
Package changenotify tests rclone's changenotify support
Package changenotify tests rclone's changenotify support
makefiles
Package makefiles builds a directory structure with the required number of files in of the required size.
Package makefiles builds a directory structure with the required number of files in of the required size.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL