user

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommandUpdate = &cli.Command{
	Name:        "user",
	Description: "Use this command to update a user.",
	Usage:       "Update a user from the provided configuration",
	Action:      update,
	Flags: []cli.Flag{

		&cli.StringFlag{
			EnvVars: []string{"VELA_USER_NAME", "USER_NAME"},
			Name:    internal.FlagName,
			Usage:   "provide the name of the user",
		},
		&cli.StringSliceFlag{
			EnvVars: []string{"VELA_USER_ADD_FAVORITES", "USER_ADD_FAVORITES"},
			Name:    "add-favorites",
			Usage:   "provide the list of repositories to add as favorites for the user",
		},
		&cli.StringSliceFlag{
			EnvVars: []string{"VELA_USER_DROP_FAVORITES", "USER_DROP_FAVORITES"},
			Name:    "drop-favorites",
			Usage:   "provide the list of repositories to remove from favorites of the user",
		},
		&cli.StringSliceFlag{
			EnvVars: []string{"VELA_USER_ADD_DASHBOARDS", "USER_ADD_DASHBOARDS"},
			Name:    "add-dashboards",
			Usage:   "provide the list of UUIDs for dashboards to add to the user",
		},
		&cli.StringSliceFlag{
			EnvVars: []string{"VELA_USER_DROP_DASHBOARDS", "USER_DROP_DASHBOARDS"},
			Name:    "drop-dashboards",
			Usage:   "provide the list of UUIDs for dashboareds to remove from the user",
		},

		&cli.StringFlag{
			EnvVars: []string{"VELA_OUTPUT", "REPO_OUTPUT"},
			Name:    internal.FlagOutput,
			Aliases: []string{"op"},
			Usage:   "format the output in json, spew or yaml",
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
  1. Update current user to add a repository to favorites.
    $ {{.HelpName}} --add-favorites Org-1/Repo-1
  2. Update current user to remove a repository from favorites.
    $ {{.HelpName}} --drop-favorites Org-1/Repo-1
  3. Update current user to add a dashboard.
    $ {{.HelpName}} --add-dashboards c8da1302-07d6-11ea-882f-4893bca275b8
  4. Update current user to remove a dashboard.
    $ {{.HelpName}} --drop-dashboards c8da1302-07d6-11ea-882f-4893bca275b8

DOCUMENTATION:

  https://go-vela.github.io/docs/reference/cli/user/update/
`, cli.CommandHelpTemplate),
}

CommandUpdate defines the command for updating a user.

View Source
var CommandView = &cli.Command{
	Name:        "user",
	Description: "Use this command to view a user.",
	Usage:       "View details of the provided user",
	Action:      view,
	Flags: []cli.Flag{

		&cli.StringFlag{
			EnvVars: []string{"VELA_USER_NAME", "USER_NAME"},
			Name:    internal.FlagName,
			Aliases: []string{"n"},
			Usage:   "provide the name of the user to view",
		},

		&cli.StringFlag{
			EnvVars: []string{"VELA_OUTPUT", "REPO_OUTPUT"},
			Name:    internal.FlagOutput,
			Aliases: []string{"op"},
			Usage:   "format the output in json, spew or yaml",
			Value:   "yaml",
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
  1. View details of the current user.
    $ {{.HelpName}}
  2. View details of another user (admin).
    $ {{.HelpName}} --name Octocat
  3. View details of current user with json output.
    $ {{.HelpName}} --output json

DOCUMENTATION:

  https://go-vela.github.io/docs/reference/cli/repo/view/
`, cli.CommandHelpTemplate),
}

CommandView defines the command for inspecting a user.

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