Refactor query reading from file, update docs

Add support for @file syntax in more places.
This commit is contained in:
Gordian Schoenherr
2024-12-13 12:48:38 +09:00
parent 005114839a
commit 9691b0f518
11 changed files with 101 additions and 56 deletions
+7 -1
View File
@@ -110,7 +110,11 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
queries := make([]deb.PackageQuery, len(args)-2)
for i := 0; i < len(args)-2; i++ {
queries[i], err = query.Parse(args[i+2])
value, err := GetStringOrFileContent(args[i+2])
if err != nil {
return fmt.Errorf("unable to read package query from file %s: %w", args[i+2], err)
}
queries[i], err = query.Parse(value)
if err != nil {
return fmt.Errorf("unable to %s: %s", command, err)
}
@@ -186,6 +190,8 @@ func makeCmdRepoMove() *commander.Command {
Command move moves packages matching <package-query> from local repo
<src-name> to local repo <dst-name>.
Use '@file' to read package queries from file or '@-' for stdin.
Example:
$ aptly repo move testing stable 'myapp (=0.1.12)'