Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions lib/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type Command struct {
// Commander is the interface of all commands
type Commander interface {
RunCommand() error
GetCommand() *Command
Init(args []string, options OptionMapType) error
}

Expand Down
4 changes: 4 additions & 0 deletions lib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ type ConfigCommand struct {
command Command
}

func (cc *ConfigCommand) GetCommand() (*Command) {
return &cc.command
}

var configCommand = ConfigCommand{
command: Command{
name: "config",
Expand Down
4 changes: 4 additions & 0 deletions lib/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,10 @@ var copyCommand = CopyCommand{
},
}

func (cc *CopyCommand) GetCommand() *Command {
return &cc.command
}

// function for FormatHelper interface
func (cc *CopyCommand) formatHelpForWhole() string {
return cc.command.formatHelpForWhole()
Expand Down
4 changes: 4 additions & 0 deletions lib/create_symlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ var createSymlinkCommand = CreateSymlinkCommand{
},
}

func (cc *CreateSymlinkCommand) GetCommand() *Command {
return &cc.command
}

// function for FormatHelper interface
func (cc *CreateSymlinkCommand) formatHelpForWhole() string {
return cc.command.formatHelpForWhole()
Expand Down
4 changes: 4 additions & 0 deletions lib/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ var hashCommand = HashCommand{
},
}

func (hc *HashCommand) GetCommand() *Command {
return &hc.command
}

// function for RewriteLoadConfiger interface
func (hc *HashCommand) rewriteLoadConfig(configFile string) error {
// read config file, if error exist, do not print error
Expand Down
4 changes: 4 additions & 0 deletions lib/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ var helpCommand = HelpCommand{
},
}

func (hc *HelpCommand) GetCommand() *Command {
return &hc.command
}

// function for RewriteLoadConfiger interface
func (hc *HelpCommand) rewriteLoadConfig(configFile string) error {
// read config file, if error exist, do not print error
Expand Down
4 changes: 4 additions & 0 deletions lib/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ var listCommand = ListCommand{
},
}

func (lc *ListCommand) GetCommand() *Command {
return &lc.command
}

// function for FormatHelper interface
func (lc *ListCommand) formatHelpForWhole() string {
return lc.command.formatHelpForWhole()
Expand Down
4 changes: 4 additions & 0 deletions lib/mb.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ var makeBucketCommand = MakeBucketCommand{
},
}

func (mc *MakeBucketCommand) GetCommand() *Command {
return &mc.command
}

// function for FormatHelper interface
func (mc *MakeBucketCommand) formatHelpForWhole() string {
return mc.command.formatHelpForWhole()
Expand Down
4 changes: 4 additions & 0 deletions lib/read_symlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ var readSymlinkCommand = ReadSymlinkCommand{
},
}

func (rc *ReadSymlinkCommand) GetCommand() *Command {
return &rc.command
}

// function for FormatHelper interface
func (rc *ReadSymlinkCommand) formatHelpForWhole() string {
return rc.command.formatHelpForWhole()
Expand Down
4 changes: 4 additions & 0 deletions lib/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ var restoreCommand = RestoreCommand{
},
}

func (rc *RestoreCommand) GetCommand() *Command {
return &rc.command
}

// function for FormatHelper interface
func (rc *RestoreCommand) formatHelpForWhole() string {
return rc.command.formatHelpForWhole()
Expand Down
4 changes: 4 additions & 0 deletions lib/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ var removeCommand = RemoveCommand{
},
}

func (rc *RemoveCommand) GetCommand() *Command {
return &rc.command
}

// function for FormatHelper interface
func (rc *RemoveCommand) formatHelpForWhole() string {
return rc.command.formatHelpForWhole()
Expand Down
4 changes: 4 additions & 0 deletions lib/set_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ var setACLCommand = SetACLCommand{
},
}

func (sc *SetACLCommand) GetCommand() *Command {
return &sc.command
}

// function for FormatHelper interface
func (sc *SetACLCommand) formatHelpForWhole() string {
return sc.command.formatHelpForWhole()
Expand Down
4 changes: 4 additions & 0 deletions lib/set_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ var setMetaCommand = SetMetaCommand{
},
}

func (sc *SetMetaCommand) GetCommand() *Command {
return &sc.command
}

// function for FormatHelper interface
func (sc *SetMetaCommand) formatHelpForWhole() string {
return sc.command.formatHelpForWhole()
Expand Down
4 changes: 4 additions & 0 deletions lib/signurl.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ var signURLCommand = SignurlCommand{
},
}

func (sc *SignurlCommand) GetCommand() *Command {
return &sc.command
}

// function for FormatHelper interface
func (sc *SignurlCommand) formatHelpForWhole() string {
return sc.command.formatHelpForWhole()
Expand Down
4 changes: 4 additions & 0 deletions lib/stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ var statCommand = StatCommand{
},
}

func (sc *StatCommand) GetCommand() *Command {
return &sc.command
}

// function for FormatHelper interface
func (sc *StatCommand) formatHelpForWhole() string {
return sc.command.formatHelpForWhole()
Expand Down
6 changes: 6 additions & 0 deletions lib/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ var updateCommand = UpdateCommand{
},
}


func (uc *UpdateCommand) GetCommand() *Command {
return &uc.command
}


// function for RewriteLoadConfiger interface
func (uc *UpdateCommand) rewriteLoadConfig(configFile string) error {
// read config file, if error exist, do not print error
Expand Down