Add `tea whoami` command #426

Merged
techknowlogick merged 5 commits from whoami into master 10 months ago

The User print will be used in future for list of users for admin

The User print will be used in future for list of users for admin
techknowlogick added 1 commit 10 months ago
4475b64f7c
add whoami cli option
techknowlogick added this to the v0.9.0 milestone 10 months ago
noerw reviewed 10 months ago
cmd/whoami.go Outdated
var CmdWhoami = cli.Command{
Name: "whoami",
Category: catSetup,
Description: `.`,
Collaborator

That looks odd, please use the same content of Usage or elaborate further on the functionality (this string is displayed in tea whoami --help)

That looks odd, please use the same content of `Usage` or elaborate further on the functionality (this string is displayed in `tea whoami --help`)
techknowlogick marked this conversation as resolved
noerw reviewed 10 months ago
cmd/whoami.go Outdated
"github.com/urfave/cli/v2"
)
// CmdTrackedTimes represents the command to operate repositories' times.
Collaborator

linter complains about func comment

linter complains about func comment
techknowlogick marked this conversation as resolved
noerw reviewed 10 months ago
case "language":
return x.Language
case "is_admin":
return fmt.Sprintf("%t", x.IsAdmin)
Collaborator

we have a FormatBool() helper for consistency

we have a `FormatBool()` helper for consistency
techknowlogick marked this conversation as resolved
noerw requested changes 10 months ago
noerw left a comment
Collaborator

nice feature! just some nits :)

Also, will you add a user listing command too? right now print.UserList() is dead code

nice feature! just some nits :) Also, will you add a user listing command too? right now `print.UserList()` is dead code
noerw changed title from add whoami cli option to Add `tea whoami` command 10 months ago
noerw added the
kind/feature
label 10 months ago
Poster
Owner

Also, will you add a user listing command too? right now print.UserList() is dead code

yes, I hope to add admin commands to list users (and potentially delete them too, for moderation purposes).

I've updated per your feedback, thanks :)

> Also, will you add a user listing command too? right now `print.UserList()` is dead code yes, I hope to add admin commands to list users (and potentially delete them too, for moderation purposes). I've updated per your feedback, thanks :)
axifive reviewed 10 months ago
// Copyright 2020 The Gitea Authors. All rights reserved.

2021

2021
axifive marked this conversation as resolved
"code.gitea.io/sdk/gitea"
)
// RepoDetails print an repo formatted to stdout

doc func name

doc func name
techknowlogick marked this conversation as resolved
), "")
}
// ReposList prints a listing of the repos

same

same
techknowlogick marked this conversation as resolved
techknowlogick added 1 commit 10 months ago
9cc9a32813
update date
Poster
Owner

@axifive I've updated per your feedback, please review :)

@axifive I've updated per your feedback, please review :)
noerw requested changes 10 months ago
case "language":
return x.Language
case "is_admin":
return formatBoolean(x.IsAdmin, true)
Collaborator
-		return formatBoolean(x.IsAdmin, true)
+		return formatBoolean(x.IsAdmin, !machineReadable)
```diff - return formatBoolean(x.IsAdmin, true) + return formatBoolean(x.IsAdmin, !machineReadable) ```
Poster
Owner

updated

updated
techknowlogick marked this conversation as resolved
techknowlogick added 1 commit 10 months ago
74850739aa
update per feedback
noerw approved these changes 10 months ago
Collaborator

@techknowlogick to get CI passing, we need to merge #425 and update this PR (with :magician: powers maybe? ;)

@techknowlogick to get CI passing, we need to merge #425 and update this PR (with :magician: powers maybe? ;)
axifive approved these changes 10 months ago
techknowlogick merged commit 4ffd994549 into master 10 months ago
techknowlogick deleted branch whoami 10 months ago

Reviewers

noerw approved these changes 10 months ago
axifive approved these changes 10 months ago
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
The pull request has been merged as 4ffd994549.
Sign in to join this conversation.
Loading…
There is no content yet.