1
0
Fork 0
forked from boyska/feedpanel

adduser subcommand addedd

This commit is contained in:
Blallo 2018-09-27 23:11:07 +02:00
parent 0a2388168b
commit 63fbf784aa
No known key found for this signature in database
GPG key ID: 0CBE577C9B72DC3F

View file

@ -33,8 +33,21 @@ func cmdSetup() error {
return nil return nil
} }
func cmdAddUser(user, email, pwdhash string) error {
db := getDB()
err := db.UserAdd(user, group, pwdhash)
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
fmt.Println("All done")
os.Exit(0)
return nil
}
var cmdMap map[string]commandFunc = map[string]commandFunc{ var cmdMap map[string]commandFunc = map[string]commandFunc{
"setup": cmdSetup, "setup": cmdSetup,
"adduser": cmdAddUser,
} }
func usage(w io.Writer) { func usage(w io.Writer) {