Fix --create-user usage error message

This commit is contained in:
Matt Baer 2019-01-26 11:11:17 -05:00
parent c11ede53d9
commit cd752858b7
1 changed files with 5 additions and 1 deletions

6
app.go
View File

@ -531,7 +531,11 @@ func adminCreateUser(app *app, credStr string, isAdmin bool) error {
// Create an admin user with --create-admin
creds := strings.Split(credStr, ":")
if len(creds) != 2 {
return fmt.Errorf("usage: writefreely --create-admin username:password")
c := "user"
if isAdmin {
c = "admin"
}
return fmt.Errorf("usage: writefreely --create-%s username:password", c)
}
loadConfig(app)