Adding upstream version 3.10.8.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
37e9b6d587
commit
03bfe4079e
356 changed files with 28857 additions and 0 deletions
49
cmd/main.go
Normal file
49
cmd/main.go
Normal file
|
@ -0,0 +1,49 @@
|
|||
// Copyright Earl Warren <contact@earl-warren.org>
|
||||
// Copyright Loïc Dachary <loic@dachary.org>
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"code.forgejo.org/f3/gof3/v3/logger"
|
||||
|
||||
"github.com/urfave/cli/v3"
|
||||
)
|
||||
|
||||
var Version = "development"
|
||||
|
||||
func SetVerbosity(ctx context.Context, verbosity int) {
|
||||
l := logger.ContextGetLogger(ctx)
|
||||
switch verbosity {
|
||||
case 0:
|
||||
l.SetLevel(logger.Info)
|
||||
default:
|
||||
l.SetLevel(logger.Trace)
|
||||
}
|
||||
}
|
||||
|
||||
func NewApp() *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "F3",
|
||||
Usage: "Friendly Forge Format",
|
||||
Description: `Friendly Forge Format`,
|
||||
Version: Version,
|
||||
Before: func(ctx context.Context, c *cli.Command) (context.Context, error) {
|
||||
SetVerbosity(ctx, c.Count("verbose"))
|
||||
return nil, nil
|
||||
},
|
||||
Commands: []*cli.Command{
|
||||
CreateCmdMirror(),
|
||||
},
|
||||
Flags: []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "verbose",
|
||||
Usage: "increase the verbosity level",
|
||||
},
|
||||
cli.VersionFlag,
|
||||
},
|
||||
EnableShellCompletion: true,
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue