livepeer/go-livepeer
Inserting random words on the command line stops the CLI from being parsed
Offen
#2.642 geöffnet am 31.10.2022
good first issue
Repository-Metriken
- Stars
- (583 Sterne)
- PR-Merge-Metriken
- (PR-Metriken ausstehend)
Beschreibung
Good behavior:
▶ livepeer -broadcaster -network offchain -foo=bar
flag provided but not defined: -foo
Usage of livepeer:
[snip]
Bad behavior:
▶ livepeer -broadcaster -network offchain random_nonsense -foo=bar
*-------------*------*
| Broadcaster | true |
*-------------*------*
I1031 18:09:17.953699 23455 starter.go:337] ***Livepeer is running on the offchain network***
I1031 18:09:17.956990 23455 starter.go:495] ***Livepeer is in off-chain mode***
[snip]
Actual flags on the far side of random_nonsense are ignored too:
▶ livepeer -network offchain random_nonsense -broadcaster
*
*
I1031 18:12:28.799456 23478 starter.go:337] ***Livepeer is running on the offchain network***
F1031 18:12:28.802987 23478 starter.go:460] No services enabled; must be at least one of -broadcaster, -transcoder, -orchestrator, -redeemer, -reward or -initializeRound
I suppose our CLI parsing library is seeing random_nonsense there as a subcommand? But we should be crashing if that's there, this can only cause bugs for people.