mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
docs(help): trim examples and verbose doc comments in core commands
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
7 files changed
+22
-57
No files matched your search
+5
-15
@@ -75,8 +75,7 @@ func (a *application) instanceTarget(ctx context.Context) (target, error) {
|
||||
return a.resolveTarget(ctx, false, false)
|
||||
}
|
||||
|
||||
// credentialLabel describes how an account authenticates: "token, keyring", "OAuth, file store" or
|
||||
// "SSH key".
|
||||
// credentialLabel describes how an account authenticates, such as "token, keyring".
|
||||
func credentialLabel(account settings.Account) string {
|
||||
switch account.AuthMethod {
|
||||
case settings.AuthSSH:
|
||||
@@ -130,14 +129,9 @@ how to log in, where to keep the token and whether git should use tea for the in
|
||||
|
||||
Create a token on the instance under Settings > Applications. Logging in to an account
|
||||
that tea already has replaces its stored credential after a confirmation (or with --yes).`,
|
||||
Example: `# Log in interactively
|
||||
$ tea auth login
|
||||
# Log in with a token from a file or a secret store
|
||||
Example: `$ tea auth login
|
||||
$ tea auth login --host gitea.com --with-token < token.txt
|
||||
# Log in in the browser, with read-only access to repositories
|
||||
$ tea auth login --host gitea.com --oauth --scopes read:repository,read:user
|
||||
# Sign requests with an SSH key instead of a token
|
||||
$ tea auth login --host gitea.com --ssh-key ~/.ssh/id_ed25519`,
|
||||
$ tea auth login --host gitea.com --oauth --scopes read:repository,read:user`,
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
selected := 0
|
||||
for _, chosen := range []bool{withToken, oauth, sshKey != "", sshAgentPrincipal != "", sshAgentKey != ""} {
|
||||
@@ -377,18 +371,14 @@ func defaultSSHKey() string {
|
||||
return ""
|
||||
}
|
||||
for _, name := range []string{"id_ed25519", "id_ecdsa", "id_rsa"} {
|
||||
if path := filepath.Join(home, ".ssh", name); fileExists(path) {
|
||||
path := filepath.Join(home, ".ssh", name)
|
||||
if _, err := os.Stat(path); err == nil {
|
||||
return path
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func fileExists(path string) bool {
|
||||
_, err := os.Stat(path)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
// authStatusRow is one account, or the environment token, that auth status reports.
|
||||
type authStatusRow struct {
|
||||
Host string `json:"host"`
|
||||
|
||||
Reference in new issue
Block a user