Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zemul committed Aug 2, 2023
1 parent 323b057 commit c3c2f38
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion command/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func Commands() []*cli.Command {
NewSyncCommand(),
NewVersionCommand(),
NewBucketVersionCommand(),
NewPersignCommand(),
NewPresignCommand(),
}
}

Expand Down
24 changes: 12 additions & 12 deletions command/persign.go → command/presign.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/peak/s5cmd/v2/storage/url"
)

var persignHelpTemplate = `Name:
var presignHelpTemplate = `Name:
{{.HelpName}} - {{.Usage}}
Usage:
Expand All @@ -29,11 +29,11 @@ Examples:
> s5cmd {{.HelpName}} --expire 24h s3://bucket/prefix/object
`

func NewPersignCommand() *cli.Command {
func NewPresignCommand() *cli.Command {
cmd := &cli.Command{
Name: "persign",
HelpName: "persign",
Usage: "print remote object persign url",
Name: "presign",
HelpName: "presign",
Usage: "print remote object presign url",
Flags: []cli.Flag{
&cli.DurationFlag{
Name: "expire",
Expand All @@ -45,9 +45,9 @@ func NewPersignCommand() *cli.Command {
Usage: "use the specified version of an object",
},
},
CustomHelpTemplate: persignHelpTemplate,
CustomHelpTemplate: presignHelpTemplate,
Before: func(c *cli.Context) error {
err := validatePersignCommand(c)
err := validatePresignCommand(c)
if err != nil {
printError(commandFromContext(c), c.Command.Name, err)
}
Expand All @@ -65,7 +65,7 @@ func NewPersignCommand() *cli.Command {
return err
}

return Persign{
return Presign{
src: src,
op: op,
fullCommand: fullCommand,
Expand All @@ -77,8 +77,8 @@ func NewPersignCommand() *cli.Command {
return cmd
}

// Persign holds persign operation flags and states.
type Persign struct {
// Presign holds presign operation flags and states.
type Presign struct {
src *url.URL
op string
fullCommand string
Expand All @@ -88,7 +88,7 @@ type Persign struct {
}

// Run prints content of given source to standard output.
func (c Persign) Run(ctx context.Context) error {
func (c Presign) Run(ctx context.Context) error {
client, err := storage.NewRemoteClient(ctx, c.src, c.storageOpts)
if err != nil {
printError(c.fullCommand, c.op, err)
Expand All @@ -104,7 +104,7 @@ func (c Persign) Run(ctx context.Context) error {
return nil
}

func validatePersignCommand(c *cli.Context) error {
func validatePresignCommand(c *cli.Context) error {
if c.Args().Len() != 1 {
return fmt.Errorf("expected only one argument")
}
Expand Down

0 comments on commit c3c2f38

Please sign in to comment.