Add tea whoami command #426

Merged
techknowlogick merged 5 commits from whoami into master 2021-10-04 17:42:00 +00:00

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 2021-10-04 04:10:32 +00:00
add whoami cli option
Some checks failed
continuous-integration/drone/pr Build is failing
4475b64f7c
techknowlogick added this to the v0.9.0 milestone 2021-10-04 04:10:42 +00:00
noerw reviewed 2021-10-04 09:07:11 +00:00
cmd/whoami.go Outdated
@ -0,0 +15,4 @@
var CmdWhoami = cli.Command{
Name: "whoami",
Category: catSetup,
Description: `.`,
Member

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 2021-10-04 09:07:28 +00:00
cmd/whoami.go Outdated
@ -0,0 +11,4 @@
"github.com/urfave/cli/v2"
)
// CmdTrackedTimes represents the command to operate repositories' times.
Member

linter complains about func comment

linter complains about func comment
techknowlogick marked this conversation as resolved
noerw reviewed 2021-10-04 09:09:32 +00:00
@ -0,0 +108,4 @@
case "language":
return x.Language
case "is_admin":
return fmt.Sprintf("%t", x.IsAdmin)
Member

we have a FormatBool() helper for consistency

we have a `FormatBool()` helper for consistency
techknowlogick marked this conversation as resolved
noerw requested changes 2021-10-04 09:13:58 +00:00
noerw left a comment
Member

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 2021-10-04 09:14:51 +00:00
noerw added the
kind
feature
label 2021-10-04 09:14:56 +00:00
Author
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 2021-10-04 17:19:32 +00:00
@ -0,0 +1,126 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
Member

2021

2021
axifive marked this conversation as resolved
@ -0,0 +10,4 @@
"code.gitea.io/sdk/gitea"
)
// RepoDetails print an repo formatted to stdout
Member

doc func name

doc func name
techknowlogick marked this conversation as resolved
@ -0,0 +52,4 @@
), "")
}
// ReposList prints a listing of the repos
Member

same

same
techknowlogick marked this conversation as resolved
techknowlogick added 1 commit 2021-10-04 17:21:17 +00:00
update date
Some checks reported errors
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build was killed
9cc9a32813
Author
Owner

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

@axifive I've updated per your feedback, please review :)
noerw requested changes 2021-10-04 17:28:57 +00:00
@ -0,0 +108,4 @@
case "language":
return x.Language
case "is_admin":
return formatBoolean(x.IsAdmin, true)
Member
-		return formatBoolean(x.IsAdmin, true)
+		return formatBoolean(x.IsAdmin, !machineReadable)
```diff - return formatBoolean(x.IsAdmin, true) + return formatBoolean(x.IsAdmin, !machineReadable) ```
Author
Owner

updated

updated
techknowlogick marked this conversation as resolved
techknowlogick added 1 commit 2021-10-04 17:30:09 +00:00
update per feedback
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
74850739aa
noerw approved these changes 2021-10-04 17:31:01 +00:00
Member

@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 2021-10-04 17:41:49 +00:00
techknowlogick merged commit 4ffd994549 into master 2021-10-04 17:42:00 +00:00
techknowlogick deleted branch whoami 2021-10-04 17:42:00 +00:00
Sign in to join this conversation.
No description provided.