MCPcopy Index your code
hub / github.com/dnote/dnote / userListCmd

Function userListCmd

pkg/server/cmd/user.go:154–173  ·  view source on GitHub ↗
(args []string, output io.Writer)

Source from the content-addressed store, hash-verified

152}
153
154func userListCmd(args []string, output io.Writer) {
155 fs := setupFlagSet("list", "dnote-server user list")
156
157 dbPath := fs.String("dbPath", "", "Path to SQLite database file (env: DBPath, default: $XDG_DATA_HOME/dnote/server.db)")
158
159 fs.Parse(args)
160
161 a, cleanup := createApp(fs, *dbPath)
162 defer cleanup()
163
164 users, err := a.GetAllUsers()
165 if err != nil {
166 log.ErrorWrap(err, "listing users")
167 os.Exit(1)
168 }
169
170 for _, user := range users {
171 fmt.Fprintf(output, "%s,%s,%s\n", user.UUID, user.Email.String, user.CreatedAt.UTC().Format("2006-01-02T15:04:05Z"))
172 }
173}
174
175func userCmd(args []string) {
176 if len(args) < 1 {

Callers 2

TestUserListCmdFunction · 0.85
userCmdFunction · 0.85

Calls 4

ErrorWrapFunction · 0.92
setupFlagSetFunction · 0.85
createAppFunction · 0.85
GetAllUsersMethod · 0.80

Tested by 1

TestUserListCmdFunction · 0.68