feat: return errors if filter specified by flag does not exist.

Signed-off-by: Matthis Holleville <matthish29@gmail.com>
This commit is contained in:
Matthis Holleville 2023-04-11 19:20:49 +02:00
parent 21dc61c04f
commit dd5824f436

View File

@ -3,6 +3,7 @@ package analysis
import (
"context"
"encoding/json"
"errors"
"fmt"
"strings"
@ -72,6 +73,8 @@ func (a *Analysis) RunAnalysis() error {
return err
}
a.Results = append(a.Results, results...)
} else {
return errors.New(fmt.Sprintf("\"%s\" filter does not exist. Please run k8sgpt filters list.", filter))
}
}
return nil