cmd/syncthing: Mostly replace urfave/cli command line parser with alecthomas/kong (#9166)

`syncthing cli` subcommand was using urfave/cli as the command parser.
This PR replace it with kong, which the main command uses.

Some help texts and error message format are changed. Other than that,
all the command usage and logic remains unchanged.

There's only one place which still uses urfave/cli, which is `syncthing
cli config`, because it uses some magic to dynamically build commands
from struct reflects. I used kong's `passthrough:""` tag to pass any
argument following `syncthing cli config` to urfave/cli parser.

This PR also fixes #9041

---------

Co-authored-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
cjc7373
2023-12-11 11:35:57 +01:00
committed by GitHub
co-authored by Jakob Borg
parent a2cbc62521
commit b71a930bfc
14 changed files with 298 additions and 432 deletions
+1 -3
View File
@@ -10,12 +10,10 @@ import (
"fmt"
"os"
"text/tabwriter"
"github.com/urfave/cli"
)
// indexAccount prints key and data size statistics per class
func indexAccount(*cli.Context) error {
func indexAccount() error {
ldb, err := getDB()
if err != nil {
return err