Loading repl/args.go +6 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import ( "fmt" "strconv" "strings" "time" ) // ParseNumberList takes a string with a number list Loading Loading @@ -41,3 +42,8 @@ func ParseNumberList(input string) ([]int64, error) { } return result, nil } // ParseDate converts a "yyyy-mm-dd" formatted string to time.Time. func ParseDate(arg string) (time.Time, error) { return time.Parse("2006-01-02", arg) } repl/command.go +1 −8 Original line number Diff line number Diff line Loading @@ -1630,6 +1630,7 @@ sites make BULLETIN/LOGIN an optional command for users to store in their own LOGIN.COM, so this command can be used to show which users have done this.`, MaxArgs: 1, Action: ActionShowUser, Flags: dclish.Flags{ "/ALL": { Description: ` Specifies that information for all users is to be displayed. This is a Loading Loading @@ -1658,14 +1659,6 @@ have done this.`, specified, the date of the current message is used. Only valid for folders or with /LOGIN. Use /START for newsgroups.`, }, "/START": { Description: `/START=[number] Specifies to display only those users whose latest read message number is equal to or greather than the specified number. If no number is specified, the message number of the current message is used. Only valid for newsgroups. Use /SINCE for folders and with /LOGIN.`, }, }, }, "VERSION": { Loading repl/show.go +12 −3 Original line number Diff line number Diff line Loading @@ -118,8 +118,10 @@ func ActionShowPrivileges(_ *dclish.Command) error { func ActionShowUser(cmd *dclish.Command) error { showAll := false if cmd.Flags["/ALL"].Value == "true" { // TODO: Check permissions. showAll = true // TODO: Check permissions. fmt.Println("ERROR: No privs to use command.") return nil } showLogin := false if cmd.Flags["/LOGIN"].Value == "true" { Loading @@ -131,9 +133,16 @@ func ActionShowUser(cmd *dclish.Command) error { // TODO: Check permissions. folder = folders.FindFolder(cmd.Flags["/FOLDER"].Value) } since := cmd.Flags["/FOLDER"].Value if cmd.Flags["/FOLDER"].Value != "" { since, err := ParseDate(cmd.Flags["/FOLDER"].Value) if err != nil { fmt.Println("ERROR: Invalid date specified.") return nil } fmt.Printf("TODO: select messages since %s.\n", since.Format("2006-05-04")) } fmt.Println("TODO: implement ActionShowUser.") fmt.Printf("TODO: %t %t %s %s.\n", showAll, showLogin, folder.Name, since) fmt.Printf("TODO: %t %t %s.\n", showAll, showLogin, folder.Name) return nil } Loading Loading
repl/args.go +6 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import ( "fmt" "strconv" "strings" "time" ) // ParseNumberList takes a string with a number list Loading Loading @@ -41,3 +42,8 @@ func ParseNumberList(input string) ([]int64, error) { } return result, nil } // ParseDate converts a "yyyy-mm-dd" formatted string to time.Time. func ParseDate(arg string) (time.Time, error) { return time.Parse("2006-01-02", arg) }
repl/command.go +1 −8 Original line number Diff line number Diff line Loading @@ -1630,6 +1630,7 @@ sites make BULLETIN/LOGIN an optional command for users to store in their own LOGIN.COM, so this command can be used to show which users have done this.`, MaxArgs: 1, Action: ActionShowUser, Flags: dclish.Flags{ "/ALL": { Description: ` Specifies that information for all users is to be displayed. This is a Loading Loading @@ -1658,14 +1659,6 @@ have done this.`, specified, the date of the current message is used. Only valid for folders or with /LOGIN. Use /START for newsgroups.`, }, "/START": { Description: `/START=[number] Specifies to display only those users whose latest read message number is equal to or greather than the specified number. If no number is specified, the message number of the current message is used. Only valid for newsgroups. Use /SINCE for folders and with /LOGIN.`, }, }, }, "VERSION": { Loading
repl/show.go +12 −3 Original line number Diff line number Diff line Loading @@ -118,8 +118,10 @@ func ActionShowPrivileges(_ *dclish.Command) error { func ActionShowUser(cmd *dclish.Command) error { showAll := false if cmd.Flags["/ALL"].Value == "true" { // TODO: Check permissions. showAll = true // TODO: Check permissions. fmt.Println("ERROR: No privs to use command.") return nil } showLogin := false if cmd.Flags["/LOGIN"].Value == "true" { Loading @@ -131,9 +133,16 @@ func ActionShowUser(cmd *dclish.Command) error { // TODO: Check permissions. folder = folders.FindFolder(cmd.Flags["/FOLDER"].Value) } since := cmd.Flags["/FOLDER"].Value if cmd.Flags["/FOLDER"].Value != "" { since, err := ParseDate(cmd.Flags["/FOLDER"].Value) if err != nil { fmt.Println("ERROR: Invalid date specified.") return nil } fmt.Printf("TODO: select messages since %s.\n", since.Format("2006-05-04")) } fmt.Println("TODO: implement ActionShowUser.") fmt.Printf("TODO: %t %t %s %s.\n", showAll, showLogin, folder.Name, since) fmt.Printf("TODO: %t %t %s.\n", showAll, showLogin, folder.Name) return nil } Loading