fix panic (#12)

* c.Args().Len() - 1 might be negative value

* fix getStdinLinesOrFirstArgument

* fix getStdinLinesOrFirstArgument
This commit is contained in:
mattn
2024-02-03 22:03:32 +09:00
committed by GitHub
parent 0b9e861f90
commit 01e1f52a70
5 changed files with 35 additions and 18 deletions

View File

@@ -33,7 +33,7 @@ var decode = &cli.Command{
},
ArgsUsage: "<npub | nprofile | nip05 | nevent | naddr | nsec>",
Action: func(c *cli.Context) error {
for input := range getStdinLinesOrFirstArgument(c) {
for input := range getStdinLinesOrFirstArgument(c.Args().First()) {
if strings.HasPrefix(input, "nostr:") {
input = input[6:]
}