mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-16 12:08:04 +00:00
Refactor query reading from file, update docs
Add support for @file syntax in more places.
This commit is contained in:
@@ -88,12 +88,11 @@ 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:] {
|
||||
var q string
|
||||
q, err = getContent(arg)
|
||||
value, err := GetStringOrFileContent(arg)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to read package query from file %s: %w", arg, err)
|
||||
}
|
||||
queries[i], err = query.Parse(q)
|
||||
queries[i], err = query.Parse(value)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to parse query: %s", err)
|
||||
}
|
||||
@@ -172,6 +171,8 @@ versions from <source> following dependencies. New snapshot <destination>
|
||||
is created as a result of this process. Packages could be specified simply
|
||||
as 'package-name' or as package queries.
|
||||
|
||||
Use '@file' syntax to read package queries from file and '@-' to read from stdin.
|
||||
|
||||
Example:
|
||||
|
||||
$ aptly snapshot pull wheezy-main wheezy-backports wheezy-new-xorg xorg-server-server
|
||||
|
||||
Reference in New Issue
Block a user