Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

帮助文档增加 ArgsUsage #81

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 27 additions & 18 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,9 @@ func NewInfoCommand() cli.Command {

func NewMkdirCommand() cli.Command {
return cli.Command{
Name: "mkdir",
Usage: "Make directory",
Name: "mkdir",
Usage: "Make directory",
ArgsUsage: "<remote-dir>",
Action: func(c *cli.Context) error {
InitAndCheck(LOGIN, CHECK, c)
session.Mkdir(c.Args()...)
Expand All @@ -185,8 +186,9 @@ func NewMkdirCommand() cli.Command {

func NewCdCommand() cli.Command {
return cli.Command{
Name: "cd",
Usage: "Change directory",
Name: "cd",
Usage: "Change directory",
ArgsUsage: "<remote-path>",
Action: func(c *cli.Context) error {
Init(LOGIN)
fpath := "/"
Expand Down Expand Up @@ -214,8 +216,9 @@ func NewPwdCommand() cli.Command {

func NewLsCommand() cli.Command {
return cli.Command{
Name: "ls",
Usage: "List directory or file",
Name: "ls",
Usage: "List directory or file",
ArgsUsage: "<remote-path>",
Action: func(c *cli.Context) error {
Init(LOGIN)
fpath := session.CWD
Expand Down Expand Up @@ -254,8 +257,9 @@ func NewLsCommand() cli.Command {

func NewGetCommand() cli.Command {
return cli.Command{
Name: "get",
Usage: "Get directory or file",
Name: "get",
Usage: "Get directory or file",
ArgsUsage: "[-c] <remote-path> [save-path]",
Action: func(c *cli.Context) error {
InitAndCheck(LOGIN, CHECK, c)
upPath := c.Args().First()
Expand Down Expand Up @@ -308,8 +312,9 @@ func NewGetCommand() cli.Command {

func NewPutCommand() cli.Command {
return cli.Command{
Name: "put",
Usage: "Put directory or file",
Name: "put",
Usage: "Put directory or file",
ArgsUsage: "<local-path> [remote-path]",
Action: func(c *cli.Context) error {
InitAndCheck(LOGIN, CHECK, c)
localPath := c.Args().First()
Expand Down Expand Up @@ -341,8 +346,9 @@ func NewPutCommand() cli.Command {

func NewUploadCommand() cli.Command {
return cli.Command{
Name: "upload",
Usage: "upload multiple directory or file or http url",
Name: "upload",
Usage: "upload multiple directory or file or http url",
ArgsUsage: "[local-path...] [url...] [--remote remote-path]",
Action: func(c *cli.Context) error {
InitAndCheck(LOGIN, CHECK, c)
if c.Int("w") > 10 || c.Int("w") < 1 {
Expand All @@ -364,8 +370,9 @@ func NewUploadCommand() cli.Command {

func NewRmCommand() cli.Command {
return cli.Command{
Name: "rm",
Usage: "Remove directory or file",
Name: "rm",
Usage: "Remove directory or file",
ArgsUsage: "<remote-path>",
Action: func(c *cli.Context) error {
InitAndCheck(LOGIN, CHECK, c)
fpath := c.Args().First()
Expand Down Expand Up @@ -406,8 +413,9 @@ func NewRmCommand() cli.Command {

func NewTreeCommand() cli.Command {
return cli.Command{
Name: "tree",
Usage: "List contents of directories in a tree-like format",
Name: "tree",
Usage: "List contents of directories in a tree-like format",
ArgsUsage: "<remote-path>",
Action: func(c *cli.Context) error {
Init(LOGIN)
fpath := session.CWD
Expand All @@ -426,8 +434,9 @@ func NewTreeCommand() cli.Command {

func NewSyncCommand() cli.Command {
return cli.Command{
Name: "sync",
Usage: "Sync local directory to UpYun",
Name: "sync",
Usage: "Sync local directory to UpYun",
ArgsUsage: "<local-path> [remote-path]",
Action: func(c *cli.Context) error {
InitAndCheck(LOGIN, CHECK, c)
localPath := c.Args().First()
Expand Down