cli

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var App = &cli.App{
	Name:      "passman",
	Version:   "1.0.0",
	Usage:     "generate and manage your passwords on your computer",
	UsageText: "passman [COMMANDS] [FLAGS] [ARGS]",
	Copyright: "© 2022 Harun Sasmaz",
	Authors: []*cli.Author{
		{
			Name:  "Harun Sasmaz",
			Email: "me@harunsasmaz.com",
		},
	},
	HideHelpCommand:      true,
	EnableBashCompletion: true,
	CustomAppHelpTemplate: fmt.Sprintf(`%s

WEBSITE: https://harunsasmaz.com

SUPPORT: me@harunsasmaz.com

`, cli.AppHelpTemplate),
	Commands: []*cli.Command{
		generate,
		get,
		create,
		update,
		deletes,
	},
	Before: func(context *cli.Context) error {
		var pass string
		err := store.Get("root", &pass)
		if errors.Is(err, store.ErrNotFound) || pass == "" {
			pass, err = password.Prompt("Enter a password for manager")
			if err != nil {
				return err
			}

			err = store.Put("root", pass)
			if err != nil {
				return errors.New("failed to set manager password")
			}
		}

		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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