mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 10:12:06 +03:00
cli: rename "token" into "auth"
This commit is contained in:
parent
f8cf3fea03
commit
e0b15ee764
@ -2,7 +2,6 @@ package commands
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
@ -12,7 +11,7 @@ import (
|
|||||||
"github.com/MichaelMure/git-bug/util/colors"
|
"github.com/MichaelMure/git-bug/util/colors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func runTokenBridge(cmd *cobra.Command, args []string) error {
|
func runBridgeAuth(cmd *cobra.Command, args []string) error {
|
||||||
tokens, err := core.ListTokens(repo)
|
tokens, err := core.ListTokens(repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -30,27 +29,25 @@ func runTokenBridge(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func printToken(token *core.Token) {
|
func printToken(token *core.Token) {
|
||||||
valueFmt := text.LeftPadMaxLine(token.Value, 15, 0)
|
targetFmt := text.LeftPadMaxLine(token.Target, 10, 0)
|
||||||
targetFmt := text.LeftPadMaxLine(token.Target, 7, 0)
|
|
||||||
createTimeFmt := text.LeftPadMaxLine(token.CreateTime.Format(time.RFC822), 20, 0)
|
|
||||||
|
|
||||||
fmt.Printf("%s %s %s %s\n",
|
fmt.Printf("%s %s %s %s\n",
|
||||||
token.ID().Human(),
|
colors.Cyan(token.ID().Human()),
|
||||||
colors.Magenta(targetFmt),
|
colors.Yellow(targetFmt),
|
||||||
valueFmt,
|
colors.Magenta("token"),
|
||||||
createTimeFmt,
|
token.Value,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
var bridgeTokenCmd = &cobra.Command{
|
var bridgeAuthCmd = &cobra.Command{
|
||||||
Use: "token",
|
Use: "auth",
|
||||||
Short: "List all known tokens.",
|
Short: "List all known bridge authentication credentials.",
|
||||||
PreRunE: loadRepo,
|
PreRunE: loadRepo,
|
||||||
RunE: runTokenBridge,
|
RunE: runBridgeAuth,
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.NoArgs,
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
bridgeCmd.AddCommand(bridgeTokenCmd)
|
bridgeCmd.AddCommand(bridgeAuthCmd)
|
||||||
bridgeTokenCmd.Flags().SortFlags = false
|
bridgeAuthCmd.Flags().SortFlags = false
|
||||||
}
|
}
|
@ -15,17 +15,17 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
bridgeTokenTarget string
|
bridgeAuthAddTokenTarget string
|
||||||
)
|
)
|
||||||
|
|
||||||
func runBridgeTokenAdd(cmd *cobra.Command, args []string) error {
|
func runBridgeTokenAdd(cmd *cobra.Command, args []string) error {
|
||||||
var value string
|
var value string
|
||||||
|
|
||||||
if bridgeTokenTarget == "" {
|
if bridgeAuthAddTokenTarget == "" {
|
||||||
return fmt.Errorf("token target is required")
|
return fmt.Errorf("auth target is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !core.TargetExist(bridgeTokenTarget) {
|
if !core.TargetExist(bridgeAuthAddTokenTarget) {
|
||||||
return fmt.Errorf("unknown target")
|
return fmt.Errorf("unknown target")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ func runBridgeTokenAdd(cmd *cobra.Command, args []string) error {
|
|||||||
value = strings.TrimSuffix(raw, "\n")
|
value = strings.TrimSuffix(raw, "\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
token := core.NewToken(value, bridgeTokenTarget)
|
token := core.NewToken(value, bridgeAuthAddTokenTarget)
|
||||||
if err := token.Validate(); err != nil {
|
if err := token.Validate(); err != nil {
|
||||||
return errors.Wrap(err, "invalid token")
|
return errors.Wrap(err, "invalid token")
|
||||||
}
|
}
|
||||||
@ -58,8 +58,8 @@ func runBridgeTokenAdd(cmd *cobra.Command, args []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var bridgeTokenAddCmd = &cobra.Command{
|
var bridgeAuthAddTokenCmd = &cobra.Command{
|
||||||
Use: "add",
|
Use: "add-token [<token>]",
|
||||||
Short: "Store a new token",
|
Short: "Store a new token",
|
||||||
PreRunE: loadRepo,
|
PreRunE: loadRepo,
|
||||||
RunE: runBridgeTokenAdd,
|
RunE: runBridgeTokenAdd,
|
||||||
@ -67,8 +67,8 @@ var bridgeTokenAddCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
bridgeTokenCmd.AddCommand(bridgeTokenAddCmd)
|
bridgeAuthCmd.AddCommand(bridgeAuthAddTokenCmd)
|
||||||
bridgeTokenAddCmd.Flags().StringVarP(&bridgeTokenTarget, "target", "t", "",
|
bridgeAuthAddTokenCmd.Flags().StringVarP(&bridgeAuthAddTokenTarget, "target", "t", "",
|
||||||
fmt.Sprintf("The target of the bridge. Valid values are [%s]", strings.Join(bridge.Targets(), ",")))
|
fmt.Sprintf("The target of the bridge. Valid values are [%s]", strings.Join(bridge.Targets(), ",")))
|
||||||
bridgeTokenAddCmd.Flags().SortFlags = false
|
bridgeAuthAddTokenCmd.Flags().SortFlags = false
|
||||||
}
|
}
|
@ -8,7 +8,7 @@ import (
|
|||||||
"github.com/MichaelMure/git-bug/bridge/core"
|
"github.com/MichaelMure/git-bug/bridge/core"
|
||||||
)
|
)
|
||||||
|
|
||||||
func runBridgeTokenRm(cmd *cobra.Command, args []string) error {
|
func runBridgeAuthRm(cmd *cobra.Command, args []string) error {
|
||||||
token, err := core.LoadTokenPrefix(repo, args[0])
|
token, err := core.LoadTokenPrefix(repo, args[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -23,14 +23,14 @@ func runBridgeTokenRm(cmd *cobra.Command, args []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var bridgeTokenRmCmd = &cobra.Command{
|
var bridgeAuthRmCmd = &cobra.Command{
|
||||||
Use: "rm <id>",
|
Use: "rm <id>",
|
||||||
Short: "Remove a token.",
|
Short: "Remove a credential.",
|
||||||
PreRunE: loadRepo,
|
PreRunE: loadRepo,
|
||||||
RunE: runBridgeTokenRm,
|
RunE: runBridgeAuthRm,
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
bridgeTokenCmd.AddCommand(bridgeTokenRmCmd)
|
bridgeAuthCmd.AddCommand(bridgeAuthRmCmd)
|
||||||
}
|
}
|
@ -9,28 +9,29 @@ import (
|
|||||||
"github.com/MichaelMure/git-bug/bridge/core"
|
"github.com/MichaelMure/git-bug/bridge/core"
|
||||||
)
|
)
|
||||||
|
|
||||||
func runBridgeTokenShow(cmd *cobra.Command, args []string) error {
|
func runBridgeAuthShow(cmd *cobra.Command, args []string) error {
|
||||||
token, err := core.LoadTokenPrefix(repo, args[0])
|
token, err := core.LoadTokenPrefix(repo, args[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("Id: %s\n", token.ID())
|
fmt.Printf("Id: %s\n", token.ID())
|
||||||
fmt.Printf("Value: %s\n", token.Value)
|
|
||||||
fmt.Printf("Target: %s\n", token.Target)
|
fmt.Printf("Target: %s\n", token.Target)
|
||||||
|
fmt.Printf("Type: token\n")
|
||||||
|
fmt.Printf("Value: %s\n", token.Value)
|
||||||
fmt.Printf("Creation: %s\n", token.CreateTime.Format(time.RFC822))
|
fmt.Printf("Creation: %s\n", token.CreateTime.Format(time.RFC822))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var bridgeTokenShowCmd = &cobra.Command{
|
var bridgeAuthShowCmd = &cobra.Command{
|
||||||
Use: "show",
|
Use: "show",
|
||||||
Short: "Display a token.",
|
Short: "Display an authentication credential.",
|
||||||
PreRunE: loadRepo,
|
PreRunE: loadRepo,
|
||||||
RunE: runBridgeTokenShow,
|
RunE: runBridgeAuthShow,
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
bridgeTokenCmd.AddCommand(bridgeTokenShowCmd)
|
bridgeAuthCmd.AddCommand(bridgeAuthShowCmd)
|
||||||
}
|
}
|
@ -5,12 +5,12 @@
|
|||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.PP
|
.PP
|
||||||
git\-bug\-bridge\-token\-add \- Store a new token
|
git\-bug\-bridge\-auth\-add\-token \- Store a new token
|
||||||
|
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.PP
|
.PP
|
||||||
\fBgit\-bug bridge token add [flags]\fP
|
\fBgit\-bug bridge auth add\-token [<token>] [flags]\fP
|
||||||
|
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
@ -25,9 +25,9 @@ Store a new token
|
|||||||
|
|
||||||
.PP
|
.PP
|
||||||
\fB\-h\fP, \fB\-\-help\fP[=false]
|
\fB\-h\fP, \fB\-\-help\fP[=false]
|
||||||
help for add
|
help for add\-token
|
||||||
|
|
||||||
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.PP
|
.PP
|
||||||
\fBgit\-bug\-bridge\-token(1)\fP
|
\fBgit\-bug\-bridge\-auth(1)\fP
|
@ -5,17 +5,17 @@
|
|||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.PP
|
.PP
|
||||||
git\-bug\-bridge\-token\-rm \- Remove a token.
|
git\-bug\-bridge\-auth\-rm \- Remove a credential.
|
||||||
|
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.PP
|
.PP
|
||||||
\fBgit\-bug bridge token rm <id> [flags]\fP
|
\fBgit\-bug bridge auth rm <id> [flags]\fP
|
||||||
|
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.PP
|
.PP
|
||||||
Remove a token.
|
Remove a credential.
|
||||||
|
|
||||||
|
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
@ -26,4 +26,4 @@ Remove a token.
|
|||||||
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.PP
|
.PP
|
||||||
\fBgit\-bug\-bridge\-token(1)\fP
|
\fBgit\-bug\-bridge\-auth(1)\fP
|
@ -5,17 +5,17 @@
|
|||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.PP
|
.PP
|
||||||
git\-bug\-bridge\-token\-show \- Display a token.
|
git\-bug\-bridge\-auth\-show \- Display an authentication credential.
|
||||||
|
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.PP
|
.PP
|
||||||
\fBgit\-bug bridge token show [flags]\fP
|
\fBgit\-bug bridge auth show [flags]\fP
|
||||||
|
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.PP
|
.PP
|
||||||
Display a token.
|
Display an authentication credential.
|
||||||
|
|
||||||
|
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
@ -26,4 +26,4 @@ Display a token.
|
|||||||
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.PP
|
.PP
|
||||||
\fBgit\-bug\-bridge\-token(1)\fP
|
\fBgit\-bug\-bridge\-auth(1)\fP
|
29
doc/man/git-bug-bridge-auth.1
Normal file
29
doc/man/git-bug-bridge-auth.1
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
.TH "GIT-BUG" "1" "Apr 2019" "Generated from git-bug's source code" ""
|
||||||
|
.nh
|
||||||
|
.ad l
|
||||||
|
|
||||||
|
|
||||||
|
.SH NAME
|
||||||
|
.PP
|
||||||
|
git\-bug\-bridge\-auth \- List all known bridge authentication credentials.
|
||||||
|
|
||||||
|
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.PP
|
||||||
|
\fBgit\-bug bridge auth [flags]\fP
|
||||||
|
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.PP
|
||||||
|
List all known bridge authentication credentials.
|
||||||
|
|
||||||
|
|
||||||
|
.SH OPTIONS
|
||||||
|
.PP
|
||||||
|
\fB\-h\fP, \fB\-\-help\fP[=false]
|
||||||
|
help for auth
|
||||||
|
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
.PP
|
||||||
|
\fBgit\-bug\-bridge(1)\fP, \fBgit\-bug\-bridge\-auth\-add\-token(1)\fP, \fBgit\-bug\-bridge\-auth\-rm(1)\fP, \fBgit\-bug\-bridge\-auth\-show(1)\fP
|
@ -1,29 +0,0 @@
|
|||||||
.TH "GIT-BUG" "1" "Apr 2019" "Generated from git-bug's source code" ""
|
|
||||||
.nh
|
|
||||||
.ad l
|
|
||||||
|
|
||||||
|
|
||||||
.SH NAME
|
|
||||||
.PP
|
|
||||||
git\-bug\-bridge\-token \- List all known tokens.
|
|
||||||
|
|
||||||
|
|
||||||
.SH SYNOPSIS
|
|
||||||
.PP
|
|
||||||
\fBgit\-bug bridge token [flags]\fP
|
|
||||||
|
|
||||||
|
|
||||||
.SH DESCRIPTION
|
|
||||||
.PP
|
|
||||||
List all known tokens.
|
|
||||||
|
|
||||||
|
|
||||||
.SH OPTIONS
|
|
||||||
.PP
|
|
||||||
\fB\-h\fP, \fB\-\-help\fP[=false]
|
|
||||||
help for token
|
|
||||||
|
|
||||||
|
|
||||||
.SH SEE ALSO
|
|
||||||
.PP
|
|
||||||
\fBgit\-bug\-bridge(1)\fP, \fBgit\-bug\-bridge\-token\-add(1)\fP, \fBgit\-bug\-bridge\-token\-rm(1)\fP, \fBgit\-bug\-bridge\-token\-show(1)\fP
|
|
@ -26,4 +26,4 @@ Configure and use bridges to other bug trackers.
|
|||||||
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.PP
|
.PP
|
||||||
\fBgit\-bug(1)\fP, \fBgit\-bug\-bridge\-configure(1)\fP, \fBgit\-bug\-bridge\-pull(1)\fP, \fBgit\-bug\-bridge\-push(1)\fP, \fBgit\-bug\-bridge\-rm(1)\fP, \fBgit\-bug\-bridge\-token(1)\fP
|
\fBgit\-bug(1)\fP, \fBgit\-bug\-bridge\-auth(1)\fP, \fBgit\-bug\-bridge\-configure(1)\fP, \fBgit\-bug\-bridge\-pull(1)\fP, \fBgit\-bug\-bridge\-push(1)\fP, \fBgit\-bug\-bridge\-rm(1)\fP
|
||||||
|
@ -19,9 +19,9 @@ git-bug bridge [flags]
|
|||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [git-bug](git-bug.md) - A bug tracker embedded in Git.
|
* [git-bug](git-bug.md) - A bug tracker embedded in Git.
|
||||||
|
* [git-bug bridge auth](git-bug_bridge_auth.md) - List all known bridge authentication credentials.
|
||||||
* [git-bug bridge configure](git-bug_bridge_configure.md) - Configure a new bridge.
|
* [git-bug bridge configure](git-bug_bridge_configure.md) - Configure a new bridge.
|
||||||
* [git-bug bridge pull](git-bug_bridge_pull.md) - Pull updates.
|
* [git-bug bridge pull](git-bug_bridge_pull.md) - Pull updates.
|
||||||
* [git-bug bridge push](git-bug_bridge_push.md) - Push updates.
|
* [git-bug bridge push](git-bug_bridge_push.md) - Push updates.
|
||||||
* [git-bug bridge rm](git-bug_bridge_rm.md) - Delete a configured bridge.
|
* [git-bug bridge rm](git-bug_bridge_rm.md) - Delete a configured bridge.
|
||||||
* [git-bug bridge token](git-bug_bridge_token.md) - List all known tokens.
|
|
||||||
|
|
||||||
|
25
doc/md/git-bug_bridge_auth.md
Normal file
25
doc/md/git-bug_bridge_auth.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
## git-bug bridge auth
|
||||||
|
|
||||||
|
List all known bridge authentication credentials.
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
List all known bridge authentication credentials.
|
||||||
|
|
||||||
|
```
|
||||||
|
git-bug bridge auth [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for auth
|
||||||
|
```
|
||||||
|
|
||||||
|
### SEE ALSO
|
||||||
|
|
||||||
|
* [git-bug bridge](git-bug_bridge.md) - Configure and use bridges to other bug trackers.
|
||||||
|
* [git-bug bridge auth add-token](git-bug_bridge_auth_add-token.md) - Store a new token
|
||||||
|
* [git-bug bridge auth rm](git-bug_bridge_auth_rm.md) - Remove a credential.
|
||||||
|
* [git-bug bridge auth show](git-bug_bridge_auth_show.md) - Display an authentication credential.
|
||||||
|
|
23
doc/md/git-bug_bridge_auth_add-token.md
Normal file
23
doc/md/git-bug_bridge_auth_add-token.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
## git-bug bridge auth add-token
|
||||||
|
|
||||||
|
Store a new token
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
Store a new token
|
||||||
|
|
||||||
|
```
|
||||||
|
git-bug bridge auth add-token [<token>] [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-t, --target string The target of the bridge. Valid values are [github,gitlab,launchpad-preview]
|
||||||
|
-h, --help help for add-token
|
||||||
|
```
|
||||||
|
|
||||||
|
### SEE ALSO
|
||||||
|
|
||||||
|
* [git-bug bridge auth](git-bug_bridge_auth.md) - List all known bridge authentication credentials.
|
||||||
|
|
22
doc/md/git-bug_bridge_auth_rm.md
Normal file
22
doc/md/git-bug_bridge_auth_rm.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
## git-bug bridge auth rm
|
||||||
|
|
||||||
|
Remove a credential.
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
Remove a credential.
|
||||||
|
|
||||||
|
```
|
||||||
|
git-bug bridge auth rm <id> [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for rm
|
||||||
|
```
|
||||||
|
|
||||||
|
### SEE ALSO
|
||||||
|
|
||||||
|
* [git-bug bridge auth](git-bug_bridge_auth.md) - List all known bridge authentication credentials.
|
||||||
|
|
22
doc/md/git-bug_bridge_auth_show.md
Normal file
22
doc/md/git-bug_bridge_auth_show.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
## git-bug bridge auth show
|
||||||
|
|
||||||
|
Display an authentication credential.
|
||||||
|
|
||||||
|
### Synopsis
|
||||||
|
|
||||||
|
Display an authentication credential.
|
||||||
|
|
||||||
|
```
|
||||||
|
git-bug bridge auth show [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-h, --help help for show
|
||||||
|
```
|
||||||
|
|
||||||
|
### SEE ALSO
|
||||||
|
|
||||||
|
* [git-bug bridge auth](git-bug_bridge_auth.md) - List all known bridge authentication credentials.
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
## git-bug bridge token
|
|
||||||
|
|
||||||
List all known tokens.
|
|
||||||
|
|
||||||
### Synopsis
|
|
||||||
|
|
||||||
List all known tokens.
|
|
||||||
|
|
||||||
```
|
|
||||||
git-bug bridge token [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-h, --help help for token
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [git-bug bridge](git-bug_bridge.md) - Configure and use bridges to other bug trackers.
|
|
||||||
* [git-bug bridge token add](git-bug_bridge_token_add.md) - Store a new token
|
|
||||||
* [git-bug bridge token rm](git-bug_bridge_token_rm.md) - Remove a token.
|
|
||||||
* [git-bug bridge token show](git-bug_bridge_token_show.md) - Display a token.
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
## git-bug bridge token add
|
|
||||||
|
|
||||||
Store a new token
|
|
||||||
|
|
||||||
### Synopsis
|
|
||||||
|
|
||||||
Store a new token
|
|
||||||
|
|
||||||
```
|
|
||||||
git-bug bridge token add [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-t, --target string The target of the bridge. Valid values are [github,gitlab,launchpad-preview]
|
|
||||||
-h, --help help for add
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [git-bug bridge token](git-bug_bridge_token.md) - List all known tokens.
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
|||||||
## git-bug bridge token rm
|
|
||||||
|
|
||||||
Remove a token.
|
|
||||||
|
|
||||||
### Synopsis
|
|
||||||
|
|
||||||
Remove a token.
|
|
||||||
|
|
||||||
```
|
|
||||||
git-bug bridge token rm <id> [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-h, --help help for rm
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [git-bug bridge token](git-bug_bridge_token.md) - List all known tokens.
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
|||||||
## git-bug bridge token show
|
|
||||||
|
|
||||||
Display a token.
|
|
||||||
|
|
||||||
### Synopsis
|
|
||||||
|
|
||||||
Display a token.
|
|
||||||
|
|
||||||
```
|
|
||||||
git-bug bridge token show [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-h, --help help for show
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [git-bug bridge token](git-bug_bridge_token.md) - List all known tokens.
|
|
||||||
|
|
@ -287,6 +287,93 @@ _git-bug_add()
|
|||||||
noun_aliases=()
|
noun_aliases=()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_git-bug_bridge_auth_add-token()
|
||||||
|
{
|
||||||
|
last_command="git-bug_bridge_auth_add-token"
|
||||||
|
|
||||||
|
command_aliases=()
|
||||||
|
|
||||||
|
commands=()
|
||||||
|
|
||||||
|
flags=()
|
||||||
|
two_word_flags=()
|
||||||
|
local_nonpersistent_flags=()
|
||||||
|
flags_with_completion=()
|
||||||
|
flags_completion=()
|
||||||
|
|
||||||
|
flags+=("--target=")
|
||||||
|
two_word_flags+=("--target")
|
||||||
|
two_word_flags+=("-t")
|
||||||
|
local_nonpersistent_flags+=("--target=")
|
||||||
|
|
||||||
|
must_have_one_flag=()
|
||||||
|
must_have_one_noun=()
|
||||||
|
noun_aliases=()
|
||||||
|
}
|
||||||
|
|
||||||
|
_git-bug_bridge_auth_rm()
|
||||||
|
{
|
||||||
|
last_command="git-bug_bridge_auth_rm"
|
||||||
|
|
||||||
|
command_aliases=()
|
||||||
|
|
||||||
|
commands=()
|
||||||
|
|
||||||
|
flags=()
|
||||||
|
two_word_flags=()
|
||||||
|
local_nonpersistent_flags=()
|
||||||
|
flags_with_completion=()
|
||||||
|
flags_completion=()
|
||||||
|
|
||||||
|
|
||||||
|
must_have_one_flag=()
|
||||||
|
must_have_one_noun=()
|
||||||
|
noun_aliases=()
|
||||||
|
}
|
||||||
|
|
||||||
|
_git-bug_bridge_auth_show()
|
||||||
|
{
|
||||||
|
last_command="git-bug_bridge_auth_show"
|
||||||
|
|
||||||
|
command_aliases=()
|
||||||
|
|
||||||
|
commands=()
|
||||||
|
|
||||||
|
flags=()
|
||||||
|
two_word_flags=()
|
||||||
|
local_nonpersistent_flags=()
|
||||||
|
flags_with_completion=()
|
||||||
|
flags_completion=()
|
||||||
|
|
||||||
|
|
||||||
|
must_have_one_flag=()
|
||||||
|
must_have_one_noun=()
|
||||||
|
noun_aliases=()
|
||||||
|
}
|
||||||
|
|
||||||
|
_git-bug_bridge_auth()
|
||||||
|
{
|
||||||
|
last_command="git-bug_bridge_auth"
|
||||||
|
|
||||||
|
command_aliases=()
|
||||||
|
|
||||||
|
commands=()
|
||||||
|
commands+=("add-token")
|
||||||
|
commands+=("rm")
|
||||||
|
commands+=("show")
|
||||||
|
|
||||||
|
flags=()
|
||||||
|
two_word_flags=()
|
||||||
|
local_nonpersistent_flags=()
|
||||||
|
flags_with_completion=()
|
||||||
|
flags_completion=()
|
||||||
|
|
||||||
|
|
||||||
|
must_have_one_flag=()
|
||||||
|
must_have_one_noun=()
|
||||||
|
noun_aliases=()
|
||||||
|
}
|
||||||
|
|
||||||
_git-bug_bridge_configure()
|
_git-bug_bridge_configure()
|
||||||
{
|
{
|
||||||
last_command="git-bug_bridge_configure"
|
last_command="git-bug_bridge_configure"
|
||||||
@ -400,93 +487,6 @@ _git-bug_bridge_rm()
|
|||||||
noun_aliases=()
|
noun_aliases=()
|
||||||
}
|
}
|
||||||
|
|
||||||
_git-bug_bridge_token_add()
|
|
||||||
{
|
|
||||||
last_command="git-bug_bridge_token_add"
|
|
||||||
|
|
||||||
command_aliases=()
|
|
||||||
|
|
||||||
commands=()
|
|
||||||
|
|
||||||
flags=()
|
|
||||||
two_word_flags=()
|
|
||||||
local_nonpersistent_flags=()
|
|
||||||
flags_with_completion=()
|
|
||||||
flags_completion=()
|
|
||||||
|
|
||||||
flags+=("--target=")
|
|
||||||
two_word_flags+=("--target")
|
|
||||||
two_word_flags+=("-t")
|
|
||||||
local_nonpersistent_flags+=("--target=")
|
|
||||||
|
|
||||||
must_have_one_flag=()
|
|
||||||
must_have_one_noun=()
|
|
||||||
noun_aliases=()
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-bug_bridge_token_rm()
|
|
||||||
{
|
|
||||||
last_command="git-bug_bridge_token_rm"
|
|
||||||
|
|
||||||
command_aliases=()
|
|
||||||
|
|
||||||
commands=()
|
|
||||||
|
|
||||||
flags=()
|
|
||||||
two_word_flags=()
|
|
||||||
local_nonpersistent_flags=()
|
|
||||||
flags_with_completion=()
|
|
||||||
flags_completion=()
|
|
||||||
|
|
||||||
|
|
||||||
must_have_one_flag=()
|
|
||||||
must_have_one_noun=()
|
|
||||||
noun_aliases=()
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-bug_bridge_token_show()
|
|
||||||
{
|
|
||||||
last_command="git-bug_bridge_token_show"
|
|
||||||
|
|
||||||
command_aliases=()
|
|
||||||
|
|
||||||
commands=()
|
|
||||||
|
|
||||||
flags=()
|
|
||||||
two_word_flags=()
|
|
||||||
local_nonpersistent_flags=()
|
|
||||||
flags_with_completion=()
|
|
||||||
flags_completion=()
|
|
||||||
|
|
||||||
|
|
||||||
must_have_one_flag=()
|
|
||||||
must_have_one_noun=()
|
|
||||||
noun_aliases=()
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-bug_bridge_token()
|
|
||||||
{
|
|
||||||
last_command="git-bug_bridge_token"
|
|
||||||
|
|
||||||
command_aliases=()
|
|
||||||
|
|
||||||
commands=()
|
|
||||||
commands+=("add")
|
|
||||||
commands+=("rm")
|
|
||||||
commands+=("show")
|
|
||||||
|
|
||||||
flags=()
|
|
||||||
two_word_flags=()
|
|
||||||
local_nonpersistent_flags=()
|
|
||||||
flags_with_completion=()
|
|
||||||
flags_completion=()
|
|
||||||
|
|
||||||
|
|
||||||
must_have_one_flag=()
|
|
||||||
must_have_one_noun=()
|
|
||||||
noun_aliases=()
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-bug_bridge()
|
_git-bug_bridge()
|
||||||
{
|
{
|
||||||
last_command="git-bug_bridge"
|
last_command="git-bug_bridge"
|
||||||
@ -494,11 +494,11 @@ _git-bug_bridge()
|
|||||||
command_aliases=()
|
command_aliases=()
|
||||||
|
|
||||||
commands=()
|
commands=()
|
||||||
|
commands+=("auth")
|
||||||
commands+=("configure")
|
commands+=("configure")
|
||||||
commands+=("pull")
|
commands+=("pull")
|
||||||
commands+=("push")
|
commands+=("push")
|
||||||
commands+=("rm")
|
commands+=("rm")
|
||||||
commands+=("token")
|
|
||||||
|
|
||||||
flags=()
|
flags=()
|
||||||
two_word_flags=()
|
two_word_flags=()
|
||||||
|
@ -48,11 +48,28 @@ Register-ArgumentCompleter -Native -CommandName 'git-bug' -ScriptBlock {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
'git-bug;bridge' {
|
'git-bug;bridge' {
|
||||||
|
[CompletionResult]::new('auth', 'auth', [CompletionResultType]::ParameterValue, 'List all known bridge authentication credentials.')
|
||||||
[CompletionResult]::new('configure', 'configure', [CompletionResultType]::ParameterValue, 'Configure a new bridge.')
|
[CompletionResult]::new('configure', 'configure', [CompletionResultType]::ParameterValue, 'Configure a new bridge.')
|
||||||
[CompletionResult]::new('pull', 'pull', [CompletionResultType]::ParameterValue, 'Pull updates.')
|
[CompletionResult]::new('pull', 'pull', [CompletionResultType]::ParameterValue, 'Pull updates.')
|
||||||
[CompletionResult]::new('push', 'push', [CompletionResultType]::ParameterValue, 'Push updates.')
|
[CompletionResult]::new('push', 'push', [CompletionResultType]::ParameterValue, 'Push updates.')
|
||||||
[CompletionResult]::new('rm', 'rm', [CompletionResultType]::ParameterValue, 'Delete a configured bridge.')
|
[CompletionResult]::new('rm', 'rm', [CompletionResultType]::ParameterValue, 'Delete a configured bridge.')
|
||||||
[CompletionResult]::new('token', 'token', [CompletionResultType]::ParameterValue, 'List all known tokens.')
|
break
|
||||||
|
}
|
||||||
|
'git-bug;bridge;auth' {
|
||||||
|
[CompletionResult]::new('add-token', 'add-token', [CompletionResultType]::ParameterValue, 'Store a new token')
|
||||||
|
[CompletionResult]::new('rm', 'rm', [CompletionResultType]::ParameterValue, 'Remove a credential.')
|
||||||
|
[CompletionResult]::new('show', 'show', [CompletionResultType]::ParameterValue, 'Display an authentication credential.')
|
||||||
|
break
|
||||||
|
}
|
||||||
|
'git-bug;bridge;auth;add-token' {
|
||||||
|
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'The target of the bridge. Valid values are [github,gitlab,launchpad-preview]')
|
||||||
|
[CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'The target of the bridge. Valid values are [github,gitlab,launchpad-preview]')
|
||||||
|
break
|
||||||
|
}
|
||||||
|
'git-bug;bridge;auth;rm' {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
'git-bug;bridge;auth;show' {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
'git-bug;bridge;configure' {
|
'git-bug;bridge;configure' {
|
||||||
@ -84,23 +101,6 @@ Register-ArgumentCompleter -Native -CommandName 'git-bug' -ScriptBlock {
|
|||||||
'git-bug;bridge;rm' {
|
'git-bug;bridge;rm' {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
'git-bug;bridge;token' {
|
|
||||||
[CompletionResult]::new('add', 'add', [CompletionResultType]::ParameterValue, 'Store a new token')
|
|
||||||
[CompletionResult]::new('rm', 'rm', [CompletionResultType]::ParameterValue, 'Remove a token.')
|
|
||||||
[CompletionResult]::new('show', 'show', [CompletionResultType]::ParameterValue, 'Display a token.')
|
|
||||||
break
|
|
||||||
}
|
|
||||||
'git-bug;bridge;token;add' {
|
|
||||||
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'The target of the bridge. Valid values are [github,gitlab,launchpad-preview]')
|
|
||||||
[CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'The target of the bridge. Valid values are [github,gitlab,launchpad-preview]')
|
|
||||||
break
|
|
||||||
}
|
|
||||||
'git-bug;bridge;token;rm' {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
'git-bug;bridge;token;show' {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
'git-bug;commands' {
|
'git-bug;commands' {
|
||||||
[CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'Output the command description as well as Markdown compatible comment')
|
[CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'Output the command description as well as Markdown compatible comment')
|
||||||
[CompletionResult]::new('--pretty', 'pretty', [CompletionResultType]::ParameterName, 'Output the command description as well as Markdown compatible comment')
|
[CompletionResult]::new('--pretty', 'pretty', [CompletionResultType]::ParameterName, 'Output the command description as well as Markdown compatible comment')
|
||||||
|
@ -114,17 +114,20 @@ function _git-bug_bridge {
|
|||||||
case $state in
|
case $state in
|
||||||
cmnds)
|
cmnds)
|
||||||
commands=(
|
commands=(
|
||||||
|
"auth:List all known bridge authentication credentials."
|
||||||
"configure:Configure a new bridge."
|
"configure:Configure a new bridge."
|
||||||
"pull:Pull updates."
|
"pull:Pull updates."
|
||||||
"push:Push updates."
|
"push:Push updates."
|
||||||
"rm:Delete a configured bridge."
|
"rm:Delete a configured bridge."
|
||||||
"token:List all known tokens."
|
|
||||||
)
|
)
|
||||||
_describe "command" commands
|
_describe "command" commands
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$words[1]" in
|
case "$words[1]" in
|
||||||
|
auth)
|
||||||
|
_git-bug_bridge_auth
|
||||||
|
;;
|
||||||
configure)
|
configure)
|
||||||
_git-bug_bridge_configure
|
_git-bug_bridge_configure
|
||||||
;;
|
;;
|
||||||
@ -137,10 +140,52 @@ function _git-bug_bridge {
|
|||||||
rm)
|
rm)
|
||||||
_git-bug_bridge_rm
|
_git-bug_bridge_rm
|
||||||
;;
|
;;
|
||||||
token)
|
esac
|
||||||
_git-bug_bridge_token
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _git-bug_bridge_auth {
|
||||||
|
local -a commands
|
||||||
|
|
||||||
|
_arguments -C \
|
||||||
|
"1: :->cmnds" \
|
||||||
|
"*::arg:->args"
|
||||||
|
|
||||||
|
case $state in
|
||||||
|
cmnds)
|
||||||
|
commands=(
|
||||||
|
"add-token:Store a new token"
|
||||||
|
"rm:Remove a credential."
|
||||||
|
"show:Display an authentication credential."
|
||||||
|
)
|
||||||
|
_describe "command" commands
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
case "$words[1]" in
|
||||||
|
add-token)
|
||||||
|
_git-bug_bridge_auth_add-token
|
||||||
|
;;
|
||||||
|
rm)
|
||||||
|
_git-bug_bridge_auth_rm
|
||||||
|
;;
|
||||||
|
show)
|
||||||
|
_git-bug_bridge_auth_show
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
function _git-bug_bridge_auth_add-token {
|
||||||
|
_arguments \
|
||||||
|
'(-t --target)'{-t,--target}'[The target of the bridge. Valid values are [github,gitlab,launchpad-preview]]:'
|
||||||
|
}
|
||||||
|
|
||||||
|
function _git-bug_bridge_auth_rm {
|
||||||
|
_arguments
|
||||||
|
}
|
||||||
|
|
||||||
|
function _git-bug_bridge_auth_show {
|
||||||
|
_arguments
|
||||||
}
|
}
|
||||||
|
|
||||||
function _git-bug_bridge_configure {
|
function _git-bug_bridge_configure {
|
||||||
@ -168,51 +213,6 @@ function _git-bug_bridge_rm {
|
|||||||
_arguments
|
_arguments
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function _git-bug_bridge_token {
|
|
||||||
local -a commands
|
|
||||||
|
|
||||||
_arguments -C \
|
|
||||||
"1: :->cmnds" \
|
|
||||||
"*::arg:->args"
|
|
||||||
|
|
||||||
case $state in
|
|
||||||
cmnds)
|
|
||||||
commands=(
|
|
||||||
"add:Store a new token"
|
|
||||||
"rm:Remove a token."
|
|
||||||
"show:Display a token."
|
|
||||||
)
|
|
||||||
_describe "command" commands
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "$words[1]" in
|
|
||||||
add)
|
|
||||||
_git-bug_bridge_token_add
|
|
||||||
;;
|
|
||||||
rm)
|
|
||||||
_git-bug_bridge_token_rm
|
|
||||||
;;
|
|
||||||
show)
|
|
||||||
_git-bug_bridge_token_show
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
function _git-bug_bridge_token_add {
|
|
||||||
_arguments \
|
|
||||||
'(-t --target)'{-t,--target}'[The target of the bridge. Valid values are [github,gitlab,launchpad-preview]]:'
|
|
||||||
}
|
|
||||||
|
|
||||||
function _git-bug_bridge_token_rm {
|
|
||||||
_arguments
|
|
||||||
}
|
|
||||||
|
|
||||||
function _git-bug_bridge_token_show {
|
|
||||||
_arguments
|
|
||||||
}
|
|
||||||
|
|
||||||
function _git-bug_commands {
|
function _git-bug_commands {
|
||||||
_arguments \
|
_arguments \
|
||||||
'(-p --pretty)'{-p,--pretty}'[Output the command description as well as Markdown compatible comment]'
|
'(-p --pretty)'{-p,--pretty}'[Output the command description as well as Markdown compatible comment]'
|
||||||
|
Loading…
Reference in New Issue
Block a user