Fix selector behaviour (#26)
Badges / coveralls (push) Successful in 1m4s

Co-authored-by: Natercio Moniz <[email protected]>
Co-committed-by: Natercio Moniz <[email protected]>
This commit was merged in pull request #26.
This commit is contained in:
2026-07-11 15:24:54 +01:00
committed by natercio
parent 8b2c4aa6fe
commit 1ce8561782
6 changed files with 66 additions and 65 deletions
+3 -5
View File
@@ -25,7 +25,7 @@ var (
format = pflag.StringP("format", "f", "table", "Output format: table or csv")
ofAPIKey = pflag.String("open-figi-api-key", "", "An OpenFIGI API key for faster report generation (better rate api rate limits)")
// TODO: improve documentation on selectors
selectors = pflag.StringSlice("selectors", nil, "Only process entries that conform to all the selectors:")
selectors = pflag.StringSlice("selectors", nil, "Only process entries that conform to all the selectors: code, assetCountry")
)
func main() {
@@ -51,13 +51,11 @@ func run(ctx context.Context) error {
slog.SetDefault(slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: logLevel})))
if platform == nil || len(*platform) == 0 {
slog.Error("--platform flag is required")
os.Exit(1)
return fmt.Errorf("--platform flag is required")
}
if lang == nil || len(*lang) == 0 {
slog.Error("--language flag is required")
os.Exit(1)
return fmt.Errorf("--language flag is required")
}
reader, err := getReader(*platform, *ofAPIKey)