Generalize to read filter from file or stdin.

This commit is contained in:
Christof Warlich authored and Gordian Schoenherr committed 2024-12-13 11:24:54 +09:00
1 parent a5d322252a
commit 005114839a
5 files changed
+55 -42

No files matched your search

+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)
}