aboutsummaryrefslogtreecommitdiff
path: root/cmd/syncthing/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/syncthing/main.go')
-rw-r--r--cmd/syncthing/main.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go
index ab3c76e73..6d2216290 100644
--- a/cmd/syncthing/main.go
+++ b/cmd/syncthing/main.go
@@ -32,6 +32,7 @@ import (
"github.com/alecthomas/kong"
"github.com/thejerf/suture/v4"
+ "github.com/willabides/kongplete"
"github.com/syncthing/syncthing/cmd/syncthing/cli"
"github.com/syncthing/syncthing/cmd/syncthing/cmdutil"
@@ -133,10 +134,11 @@ var (
// commands and options here are top level commands to syncthing.
// Cli is just a placeholder for the help text (see main).
var entrypoint struct {
- Serve serveOptions `cmd:"" help:"Run Syncthing"`
- Generate generate.CLI `cmd:"" help:"Generate key and config, then exit"`
- Decrypt decrypt.CLI `cmd:"" help:"Decrypt or verify an encrypted folder"`
- Cli cli.CLI `cmd:"" help:"Command line interface for Syncthing"`
+ Serve serveOptions `cmd:"" help:"Run Syncthing"`
+ Generate generate.CLI `cmd:"" help:"Generate key and config, then exit"`
+ Decrypt decrypt.CLI `cmd:"" help:"Decrypt or verify an encrypted folder"`
+ Cli cli.CLI `cmd:"" help:"Command line interface for Syncthing"`
+ InstallCompletions kongplete.InstallCompletions `cmd:"" help:"Print commands to install shell completions"`
}
// serveOptions are the options for the `syncthing serve` command.
@@ -247,6 +249,7 @@ func main() {
log.Fatal(err)
}
+ kongplete.Complete(parser)
ctx, err := parser.Parse(args)
parser.FatalIfErrorf(err)
ctx.BindTo(l, (*logger.Logger)(nil)) // main logger available to subcommands