Add RunCustom command to allow passing in a TokenHelper

This commit is contained in:
Jeff Mitchell
2018-03-16 11:31:00 -04:00
parent d7a46c631c
commit 130168c447
3 changed files with 175 additions and 82 deletions

View File

@@ -114,6 +114,11 @@ func (c *BaseCommand) Client() (*api.Client, error) {
return client, nil
}
// SetTokenHelper sets the token helper on the command.
func (c *BaseCommand) SetTokenHelper(th token.TokenHelper) {
c.tokenHelper = th
}
// TokenHelper returns the token helper attached to the command.
func (c *BaseCommand) TokenHelper() (token.TokenHelper, error) {
if c.tokenHelper != nil {