cmd

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoggerKey contextKey = iota
)

Variables

View Source
var Cmd = &cli.App{
	Name:  "nurli",
	Usage: "Self-hosted and lightning-fast bookmark manager",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "data-dir",
			EnvVars: []string{"NURLI_DATA_DIR"},
			Value:   "",
		},
		&cli.BoolFlag{
			Name:    "debug",
			EnvVars: []string{"NURLI_DEBUG"},
			Value:   false,
		},
	},
	Commands: []*cli.Command{versionCmd, serveCmd, migrateCmd, bookmarkCmd, tagCmd, importCmd},
	Before: func(cCtx *cli.Context) error {
		newLogger := core.NewZerologGORMLogger(cCtx.Bool("debug"), logger.Config{
			SlowThreshold: time.Second,
		})
		newLogger.LogMode(logger.Info)
		ctx := context.WithValue(cCtx.Context, LoggerKey, newLogger)
		cCtx.Context = ctx
		return nil
	},
}
View Source
var (
	Version = "development"
)

Functions

func Execute

func Execute() error

func GetUserInput

func GetUserInput() (text string)

func GetUserSecureInput

func GetUserSecureInput() (text string)

func PrintListHeader

func PrintListHeader(columnNames ...string)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL