Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bulletin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kevin Lyda
bulletin
Commits
561977c3
Unverified
Commit
561977c3
authored
2 weeks ago
by
Kevin Lyda
Browse files
Options
Downloads
Patches
Plain Diff
More on SHOW USER
Add another arg parser - ParseDate. Flesh out the /SINCE flag.
parent
fef67c76
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
repl/args.go
+6
-0
6 additions, 0 deletions
repl/args.go
repl/command.go
+1
-8
1 addition, 8 deletions
repl/command.go
repl/show.go
+12
-3
12 additions, 3 deletions
repl/show.go
with
19 additions
and
11 deletions
repl/args.go
+
6
−
0
View file @
561977c3
...
...
@@ -4,6 +4,7 @@ import (
"fmt"
"strconv"
"strings"
"time"
)
// ParseNumberList takes a string with a number list
...
...
@@ -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
)
}
This diff is collapsed.
Click to expand it.
repl/command.go
+
1
−
8
View file @
561977c3
...
...
@@ -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
...
...
@@ -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"
:
{
...
...
This diff is collapsed.
Click to expand it.
repl/show.go
+
12
−
3
View file @
561977c3
...
...
@@ -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"
{
...
...
@@ -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
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment