Generalize to read filter from file or stdin.

This commit is contained in:
Christof Warlich
2024-09-25 08:42:02 +00:00
committed by Gordian Schoenherr
parent a5d322252a
commit 005114839a
5 changed files with 55 additions and 42 deletions
+6 -1
View File
@@ -88,7 +88,12 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error {
// Initial queries out of arguments
queries := make([]deb.PackageQuery, len(args)-3)
for i, arg := range args[3:] {
queries[i], err = query.Parse(arg)
var q string
q, err = getContent(arg)
if err != nil {
return fmt.Errorf("unable to read package query from file %s: %w", arg, err)
}
queries[i], err = query.Parse(q)
if err != nil {
return fmt.Errorf("unable to parse query: %s", err)
}