diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-12 09:55:13 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-12 09:55:13 +0200 |
commit | d0443659123f912e9385e27efebe4b7da65aa2f6 (patch) | |
tree | 090a36d2618ecff259cbcabd501d33d460d1cd7a /commands/commands.go | |
parent | a85730cf5287d40a1e32d3a671ba2296c73387cb (diff) | |
download | git-bug-d0443659123f912e9385e27efebe4b7da65aa2f6.tar.gz |
more experiment
Diffstat (limited to 'commands/commands.go')
-rw-r--r-- | commands/commands.go | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/commands/commands.go b/commands/commands.go new file mode 100644 index 00000000..4f892fdd --- /dev/null +++ b/commands/commands.go @@ -0,0 +1,40 @@ +// Package commands contains the assorted sub commands supported by the git-bug tool. +package commands + +import ( + "github.com/MichaelMure/git-bug/repository" +) + +const bugsRefPattern = "refs/bugs/*" + +// Command represents the definition of a single command. +type Command struct { + Usage func(string) + RunMethod func(repository.Repo, []string) error +} + +// Run executes a command, given its arguments. +// +// The args parameter is all of the command line args that followed the +// subcommand. +func (cmd *Command) Run(repo repository.Repo, args []string) error { + return cmd.RunMethod(repo, args) +} + +// CommandMap defines all of the available (sub)commands. +var CommandMap = map[string]*Command{ + "pull": pullCmd, + "push": pushCmd, + + /*"abandon": abandonCmd, + "accept": acceptCmd, + "comment": commentCmd, + "list": listCmd, + "pull": pullCmd, + "push": pushCmd, + "rebase": rebaseCmd, + "reject": rejectCmd, + "request": requestCmd, + "show": showCmd, + "submit": submitCmd,*/ +} |