aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-05-29 20:50:30 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-05-29 22:58:01 +0200
commitd064a7127ec612a804e08143c7098bbc60332e83 (patch)
tree222d92b6e199f5050799782e9a41e229ac625833
parent45d47a0966410840dfe4e90584ba0147eb334634 (diff)
downloadgit-bug-d064a7127ec612a804e08143c7098bbc60332e83.tar.gz
Update man pages and bash_completion
-rw-r--r--doc/man/git-bug-bridge-configure.187
-rw-r--r--doc/man/git-bug-bridge-rm.12
-rw-r--r--doc/md/git-bug_bridge_configure.md60
-rw-r--r--doc/md/git-bug_bridge_rm.md2
-rw-r--r--misc/bash_completion/git-bug24
5 files changed, 170 insertions, 5 deletions
diff --git a/doc/man/git-bug-bridge-configure.1 b/doc/man/git-bug-bridge-configure.1
index 27dfeac0..21ea7df1 100644
--- a/doc/man/git-bug-bridge-configure.1
+++ b/doc/man/git-bug-bridge-configure.1
@@ -15,15 +15,100 @@ git\-bug\-bridge\-configure \- Configure a new bridge.
.SH DESCRIPTION
.PP
-Configure a new bridge.
+.RS
+
+.nf
+Configure a new bridge by passing flags or/and using interactive terminal prompts. You can avoid all the terminal prompts by passing all the necessary flags to configure your bridge.
+Repository configuration can be made by passing either the \-\-url flag or the \-\-project and \-\-owner flags. If the three flags are provided git\-bug will use \-\-project and \-\-owner flags.
+Token configuration can be directly passed with the \-\-token flag or in the terminal prompt. If you don't already have one you can use the interactive procedure to generate one.
+
+.fi
+.RE
.SH OPTIONS
.PP
+\fB\-n\fP, \fB\-\-name\fP=""
+ A distinctive name to identify the bridge
+
+.PP
+\fB\-t\fP, \fB\-\-target\fP=""
+ The target of the bridge. Valid values are [github,launchpad\-preview]
+
+.PP
+\fB\-u\fP, \fB\-\-url\fP=""
+ The URL of the target repository
+
+.PP
+\fB\-o\fP, \fB\-\-owner\fP=""
+ The owner of the target repository
+
+.PP
+\fB\-T\fP, \fB\-\-token\fP=""
+ The authentication token for the API
+
+.PP
+\fB\-p\fP, \fB\-\-project\fP=""
+ The name of the target repository
+
+.PP
\fB\-h\fP, \fB\-\-help\fP[=false]
help for configure
+.SH EXAMPLE
+.PP
+.RS
+
+.nf
+# Interactive example
+[1]: github
+[2]: launchpad\-preview
+target: 1
+name [default]: default
+
+Detected projects:
+[1]: github.com/a\-hilaly/git\-bug
+[2]: github.com/MichaelMure/git\-bug
+
+[0]: Another project
+
+Select option: 1
+
+[0]: user provided token
+[1]: interactive token creation
+Select option: 0
+
+You can generate a new token by visiting https://github.com/settings/tokens.
+Choose 'Generate new token' and set the necessary access scope for your repository.
+
+The access scope depend on the type of repository.
+Public:
+ \- 'public\_repo': to be able to read public repositories
+Private:
+ \- 'repo' : to be able to read private repositories
+
+Enter token:
+Successfully configured bridge: default
+
+# For Github
+git bug bridge configure \\
+ \-\-name=default \\
+ \-\-target=github \\
+ \-\-owner=$(OWNER) \\
+ \-\-project=$(PROJECT) \\
+ \-\-token=$(TOKEN)
+
+# For Launchpad
+git bug bridge configure \\
+ \-\-name=default \\
+ \-\-target=launchpad\-preview \\
+ \-\-url=https://bugs.launchpad.net/ubuntu/
+
+.fi
+.RE
+
+
.SH SEE ALSO
.PP
\fBgit\-bug\-bridge(1)\fP
diff --git a/doc/man/git-bug-bridge-rm.1 b/doc/man/git-bug-bridge-rm.1
index 630eba93..324d4237 100644
--- a/doc/man/git-bug-bridge-rm.1
+++ b/doc/man/git-bug-bridge-rm.1
@@ -10,7 +10,7 @@ git\-bug\-bridge\-rm \- Delete a configured bridge.
.SH SYNOPSIS
.PP
-\fBgit\-bug bridge rm name <name> [flags]\fP
+\fBgit\-bug bridge rm <name> [flags]\fP
.SH DESCRIPTION
diff --git a/doc/md/git-bug_bridge_configure.md b/doc/md/git-bug_bridge_configure.md
index 63fbbbca..db603b48 100644
--- a/doc/md/git-bug_bridge_configure.md
+++ b/doc/md/git-bug_bridge_configure.md
@@ -4,16 +4,72 @@ Configure a new bridge.
### Synopsis
-Configure a new bridge.
+ Configure a new bridge by passing flags or/and using interactive terminal prompts. You can avoid all the terminal prompts by passing all the necessary flags to configure your bridge.
+ Repository configuration can be made by passing either the --url flag or the --project and --owner flags. If the three flags are provided git-bug will use --project and --owner flags.
+ Token configuration can be directly passed with the --token flag or in the terminal prompt. If you don't already have one you can use the interactive procedure to generate one.
```
git-bug bridge configure [flags]
```
+### Examples
+
+```
+# Interactive example
+[1]: github
+[2]: launchpad-preview
+target: 1
+name [default]: default
+
+Detected projects:
+[1]: github.com/a-hilaly/git-bug
+[2]: github.com/MichaelMure/git-bug
+
+[0]: Another project
+
+Select option: 1
+
+[0]: user provided token
+[1]: interactive token creation
+Select option: 0
+
+You can generate a new token by visiting https://github.com/settings/tokens.
+Choose 'Generate new token' and set the necessary access scope for your repository.
+
+The access scope depend on the type of repository.
+Public:
+ - 'public_repo': to be able to read public repositories
+Private:
+ - 'repo' : to be able to read private repositories
+
+Enter token:
+Successfully configured bridge: default
+
+# For Github
+git bug bridge configure \
+ --name=default \
+ --target=github \
+ --owner=$(OWNER) \
+ --project=$(PROJECT) \
+ --token=$(TOKEN)
+
+# For Launchpad
+git bug bridge configure \
+ --name=default \
+ --target=launchpad-preview \
+ --url=https://bugs.launchpad.net/ubuntu/
+```
+
### Options
```
- -h, --help help for configure
+ -n, --name string A distinctive name to identify the bridge
+ -t, --target string The target of the bridge. Valid values are [github,launchpad-preview]
+ -u, --url string The URL of the target repository
+ -o, --owner string The owner of the target repository
+ -T, --token string The authentication token for the API
+ -p, --project string The name of the target repository
+ -h, --help help for configure
```
### SEE ALSO
diff --git a/doc/md/git-bug_bridge_rm.md b/doc/md/git-bug_bridge_rm.md
index ab58e969..54941b2f 100644
--- a/doc/md/git-bug_bridge_rm.md
+++ b/doc/md/git-bug_bridge_rm.md
@@ -7,7 +7,7 @@ Delete a configured bridge.
Delete a configured bridge.
```
-git-bug bridge rm name <name> [flags]
+git-bug bridge rm <name> [flags]
```
### Options
diff --git a/misc/bash_completion/git-bug b/misc/bash_completion/git-bug
index 51e30da0..741dcc49 100644
--- a/misc/bash_completion/git-bug
+++ b/misc/bash_completion/git-bug
@@ -301,6 +301,30 @@ _git-bug_bridge_configure()
flags_with_completion=()
flags_completion=()
+ flags+=("--name=")
+ two_word_flags+=("--name")
+ two_word_flags+=("-n")
+ local_nonpersistent_flags+=("--name=")
+ flags+=("--target=")
+ two_word_flags+=("--target")
+ two_word_flags+=("-t")
+ local_nonpersistent_flags+=("--target=")
+ flags+=("--url=")
+ two_word_flags+=("--url")
+ two_word_flags+=("-u")
+ local_nonpersistent_flags+=("--url=")
+ flags+=("--owner=")
+ two_word_flags+=("--owner")
+ two_word_flags+=("-o")
+ local_nonpersistent_flags+=("--owner=")
+ flags+=("--token=")
+ two_word_flags+=("--token")
+ two_word_flags+=("-T")
+ local_nonpersistent_flags+=("--token=")
+ flags+=("--project=")
+ two_word_flags+=("--project")
+ two_word_flags+=("-p")
+ local_nonpersistent_flags+=("--project=")
must_have_one_flag=()
must_have_one_noun=()