Loading ask/ask.go +8 −0 Original line number Diff line number Diff line Loading @@ -52,3 +52,11 @@ func Choose(prompt string, choices []string) (int, error) { } return choice, nil } // YesNo converts an int64 to "yes" (`!= 0`) or "no" (`== 0`). func YesNo(num int64) string { if num != 0 { return "yes" } return "no" } repl/command.go +1 −0 Original line number Diff line number Diff line Loading @@ -1485,6 +1485,7 @@ have been set.`, Description: `Shows the privileges necessary to use privileged commands. Also shows any rights identifiers that would also give a user privileges. (The latter are ACLs which are set on the BULLUSER.DAT file.)`, Action: ActionShowPrivileges, }, "USER": { Description: `Shows the last time that a user logged in, or if /FOLDER is specified, Loading repl/show.go +5 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ import ( "github.com/carlmjohnson/versioninfo" "git.lyda.ie/kevin/bulletin/ask" "git.lyda.ie/kevin/bulletin/dclish" "git.lyda.ie/kevin/bulletin/folders" "git.lyda.ie/kevin/bulletin/storage" Loading Loading @@ -117,7 +118,10 @@ func ActionShowNew(_ *dclish.Command) error { // ActionShowPrivileges handles the `SHOW PRIVILEGES` command. func ActionShowPrivileges(_ *dclish.Command) error { fmt.Println("TODO: implement ActionShowPrivileges.") fmt.Printf("Account privileges for %s:\n", this.User.Login) fmt.Printf(" Admin : %s\n", ask.YesNo(this.User.Admin)) fmt.Printf(" Moderator : %s\n", ask.YesNo(this.User.Moderator)) fmt.Printf(" Alert : %s\n", ask.YesNo(this.User.Alert)) return nil } Loading Loading
ask/ask.go +8 −0 Original line number Diff line number Diff line Loading @@ -52,3 +52,11 @@ func Choose(prompt string, choices []string) (int, error) { } return choice, nil } // YesNo converts an int64 to "yes" (`!= 0`) or "no" (`== 0`). func YesNo(num int64) string { if num != 0 { return "yes" } return "no" }
repl/command.go +1 −0 Original line number Diff line number Diff line Loading @@ -1485,6 +1485,7 @@ have been set.`, Description: `Shows the privileges necessary to use privileged commands. Also shows any rights identifiers that would also give a user privileges. (The latter are ACLs which are set on the BULLUSER.DAT file.)`, Action: ActionShowPrivileges, }, "USER": { Description: `Shows the last time that a user logged in, or if /FOLDER is specified, Loading
repl/show.go +5 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ import ( "github.com/carlmjohnson/versioninfo" "git.lyda.ie/kevin/bulletin/ask" "git.lyda.ie/kevin/bulletin/dclish" "git.lyda.ie/kevin/bulletin/folders" "git.lyda.ie/kevin/bulletin/storage" Loading Loading @@ -117,7 +118,10 @@ func ActionShowNew(_ *dclish.Command) error { // ActionShowPrivileges handles the `SHOW PRIVILEGES` command. func ActionShowPrivileges(_ *dclish.Command) error { fmt.Println("TODO: implement ActionShowPrivileges.") fmt.Printf("Account privileges for %s:\n", this.User.Login) fmt.Printf(" Admin : %s\n", ask.YesNo(this.User.Admin)) fmt.Printf(" Moderator : %s\n", ask.YesNo(this.User.Moderator)) fmt.Printf(" Alert : %s\n", ask.YesNo(this.User.Alert)) return nil } Loading