don't fail encode when reading from stdin because of the number of arguments.

This commit is contained in:
fiatjaf 2023-10-23 08:04:21 -03:00
parent ffa41046fd
commit 50dde2117c
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1

View File

@ -20,8 +20,8 @@ var encode = &cli.Command{
nak encode nevent --author <pubkey-hex> --relay <relay-url> --relay <other-relay> <event-id>
nak encode nsec <privkey-hex>`,
Before: func(c *cli.Context) error {
if c.Args().Len() < 2 {
return fmt.Errorf("expected more than 2 arguments.")
if c.Args().Len() < 1 {
return fmt.Errorf("expected more than 1 argument.")
}
return nil
},