command

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2017 License: GPL-3.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const Name string = "prp"

Name is the name of this program

View Source
const Version string = "0.3.0"

Version is the current version

Variables

View Source
var Commands = []cli.Command{
	{
		Name:    "init-config",
		Aliases: []string{"ic"},
		Usage:   "Initialize a configuration file",
		Action:  CmdInitConfig,
	},
	{
		Name:         "parse",
		Aliases:      []string{"pa"},
		Usage:        "Parse your pull requests",
		Action:       CmdParse,
		BashComplete: CompleteParse,
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "user, owner, u",
				Usage: "Only show pull requests by owner.",
			},
			cli.StringSliceFlag{
				Name:  "repo, r",
				Usage: "Only show pull requests on a repository.",
			},
			cli.BoolFlag{
				Name:  "need-rebase, nr",
				Usage: "Only show pull requests that need a rebase.",
			},
			cli.BoolFlag{
				Name:  "verbose, v",
				Usage: "Output more info",
			},
			cli.BoolFlag{
				Name:  "use-cache, uc, c",
				Usage: "Use file cache",
			},
		},
	},
	{
		Name:    "profile",
		Aliases: []string{"pr"},
		Usage:   "Manage profiles",
		Subcommands: []cli.Command{
			{
				Name:         "add",
				Aliases:      []string{"a"},
				Usage:        "Add a profile",
				Action:       CmdProfileAdd,
				BashComplete: CompleteProfileAdd,
				Flags:        profileCrudFlags,
			},
			{
				Name:         "update",
				Aliases:      []string{"u"},
				Usage:        "Update a profile",
				Action:       CmdProfileUpdate,
				BashComplete: CompleteProfileAdd,
				Flags:        profileCrudFlags,
			},
		},
	},
	{
		Name:    "repo",
		Aliases: []string{"r"},
		Usage:   "Manage repos.",
		Subcommands: []cli.Command{
			{
				Name:         "add",
				Aliases:      []string{"a"},
				Usage:        "Add a repo",
				Action:       CmdRepoAdd,
				BashComplete: CompleteRepoAdd,
			},
			{
				Name:         "remove",
				Aliases:      []string{"r"},
				Usage:        "Remove a repo",
				Action:       CmdRepoRemove,
				BashComplete: CompleteRepoRemove,
			},
			{
				Name:         "ignore-build",
				Aliases:      []string{"ib"},
				Usage:        "Ignore a build.",
				Action:       CmdRepoIgnoreBuild,
				BashComplete: CompleteRepoIgnoreBuild,
			},
			{
				Name:         "remove-ignored-build",
				Aliases:      []string{"rib"},
				Usage:        "Remove a build from the list of ignored builds.",
				Action:       CmdRepoRemoveIgnoredBuild,
				BashComplete: CompleteRepoRemoveIgnoredBuild,
			},
			{
				Name:         "set-path",
				Aliases:      []string{"sp"},
				Usage:        "Set the path of the local clone.",
				Action:       CmdRepoSetPath,
				BashComplete: CompleteRepoSetPath,
			},
		},
	},
	{
		Name:         "auto-rebase",
		Aliases:      []string{"a", "auto"},
		Usage:        "Automatically rebase your pull requests with local path set",
		Action:       CmdAutoRebase(runner.Real{}),
		BashComplete: CompleteAutoRebase,
		Flags: []cli.Flag{
			cli.StringSliceFlag{
				Name:  "repo, r",
				Usage: "Only rebase these repos.",
			},
			cli.IntFlag{
				Name:  "pull-request-number, prNum, n",
				Usage: "A specific pull request number",
			},
			cli.BoolFlag{
				Name:  "verbose, v",
				Usage: "Output more info",
			},
			cli.BoolFlag{
				Name:  "use-cache, uc, c",
				Usage: "Use file cache",
			},
		},
	},
}

Commands defines the commands that can be called on hostBuilder

View Source
var GlobalFlags = []cli.Flag{
	cli.StringFlag{
		Name:   "config, c",
		Usage:  "The config file",
		EnvVar: "PRP_CONFIG_FILE",
	},
	cli.StringFlag{
		Name:  "profile, p",
		Usage: "The current profile",
		Value: "default",
	},
}

GlobalFlags are the flags that apply to all commands

Functions

func CmdAutoRebase

func CmdAutoRebase(cmdWrapper runner.Builder) func(*cli.Context) error

CmdAutoRebase parses the pull requests

func CmdInitConfig

func CmdInitConfig(c *cli.Context) error

CmdInitConfig creates a new config file

func CmdParse

func CmdParse(c *cli.Context) error

CmdParse parses the pull requests

func CmdProfileAdd

func CmdProfileAdd(c *cli.Context) error

CmdProfileAdd parses the pull requests

func CmdProfileUpdate

func CmdProfileUpdate(c *cli.Context) error

CmdProfileUpdate parses the pull requests

func CmdRepoAdd

func CmdRepoAdd(c *cli.Context) error

CmdRepoAdd parses the pull requests

func CmdRepoIgnoreBuild

func CmdRepoIgnoreBuild(c *cli.Context) error

CmdRepoIgnoreBuild parses the pull requests

func CmdRepoRemove

func CmdRepoRemove(c *cli.Context) error

CmdRepoRemove parses the pull requests

func CmdRepoRemoveIgnoredBuild

func CmdRepoRemoveIgnoredBuild(c *cli.Context) error

CmdRepoRemoveIgnoredBuild parses the pull requests

func CmdRepoSetPath

func CmdRepoSetPath(c *cli.Context) error

CmdRepoSetPath parses the pull requests

func CompleteAutoRebase

func CompleteAutoRebase(c *cli.Context)

CompleteAutoRebase handles bash autocompletion for the 'auto-rebase' command

func CompleteParse

func CompleteParse(c *cli.Context)

CompleteParse handles bash autocompletion for the 'parse' command

func CompleteProfileAdd

func CompleteProfileAdd(c *cli.Context)

CompleteProfileAdd handles bash autocompletion for the 'profile add' command

func CompleteRepoAdd

func CompleteRepoAdd(c *cli.Context)

CompleteRepoAdd handles bash autocompletion for the 'profile repo add' command

func CompleteRepoIgnoreBuild

func CompleteRepoIgnoreBuild(c *cli.Context)

CompleteRepoIgnoreBuild handles bash autocompletion for the 'profile repo ignore-build' command

func CompleteRepoRemove

func CompleteRepoRemove(c *cli.Context)

CompleteRepoRemove handles bash autocompletion for the 'profile repo remove' command

func CompleteRepoRemoveIgnoredBuild

func CompleteRepoRemoveIgnoredBuild(c *cli.Context)

CompleteRepoRemoveIgnoredBuild handles bash autocompletion for the 'profile repo remove-ignored-build' command

func CompleteRepoSetPath

func CompleteRepoSetPath(c *cli.Context)

CompleteRepoSetPath handles bash autocompletion for the 'profile repo set-path' command

func RootCompletion added in v0.3.1

func RootCompletion(c *cli.Context)

RootCompletion prints the list of root commands as the root completion method This is similar to the default method, but it excludes aliases

Types

This section is empty.

Jump to

Keyboard shortcuts

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