mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 07:11:08 +00:00
Add --device flag to filter pending folders.
This commit is contained in:
parent
80d4bc1cea
commit
7b0fbb6fef
@ -7,6 +7,8 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
@ -23,7 +25,21 @@ var pendingCommand = cli.Command{
|
||||
{
|
||||
Name: "folders",
|
||||
Usage: "Show pending folders",
|
||||
Action: expects(0, indexDumpOutput("cluster/pending/folders")),
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{Name: "device", Usage: "Show pending folders offered by given device"},
|
||||
},
|
||||
Action: expects(0, folders()),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func folders() cli.ActionFunc {
|
||||
return func(c *cli.Context) error {
|
||||
if c.String("device") != "" {
|
||||
query := make(url.Values)
|
||||
query.Set("device", c.String("device"))
|
||||
return indexDumpOutput("cluster/pending/folders?" + query.Encode())(c)
|
||||
}
|
||||
return indexDumpOutput("cluster/pending/folders")(c)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user