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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Personal Projects
bulletin
Commits
3a13902f
Unverified
Commit
3a13902f
authored
2 months ago
by
Kevin Lyda
Browse files
Options
Downloads
Patches
Plain Diff
Update MODIFY and a few cleanups
parent
6a821397
No related branches found
No related tags found
1 merge request
!4
Update MODIFY and a few cleanups
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
NOTES.md
+1
-0
1 addition, 0 deletions
NOTES.md
repl/folders.go
+14
-5
14 additions, 5 deletions
repl/folders.go
with
15 additions
and
5 deletions
NOTES.md
+
1
−
0
View file @
3a13902f
...
@@ -36,6 +36,7 @@ Switch between MAIL and BULLETIN modes? MAIL commands are documented
...
@@ -36,6 +36,7 @@ Switch between MAIL and BULLETIN modes? MAIL commands are documented
*
Review sql queries and clean out the ones not used.
*
Review sql queries and clean out the ones not used.
*
Review sql queries and find duplicates.
*
Review sql queries and find duplicates.
*
Use
[
dupl
](
https://github.com/mibk/dupl
)
to find things to generalise.
*
Use
[
dupl
](
https://github.com/mibk/dupl
)
to find things to generalise.
There's a
`make dupl`
target.
*
flag abbreviations with values don't seem to work?
*
flag abbreviations with values don't seem to work?
Polishing. Review each command and put a + next to each as it is
Polishing. Review each command and put a + next to each as it is
...
...
This diff is collapsed.
Click to expand it.
repl/folders.go
+
14
−
5
View file @
3a13902f
...
@@ -119,6 +119,7 @@ func ActionCreate(cmd *dclish.Command) error {
...
@@ -119,6 +119,7 @@ func ActionCreate(cmd *dclish.Command) error {
}
}
// ActionSelect handles the `SELECT` command. This selects a folder.
// ActionSelect handles the `SELECT` command. This selects a folder.
// This is based on `SELECT_FOLDER` in bulletin5.for.
func
ActionSelect
(
cmd
*
dclish
.
Command
)
error
{
func
ActionSelect
(
cmd
*
dclish
.
Command
)
error
{
if
strings
.
Contains
(
cmd
.
Args
[
0
],
"%"
)
{
if
strings
.
Contains
(
cmd
.
Args
[
0
],
"%"
)
{
return
errors
.
New
(
"Folder name cannot contain a %"
)
return
errors
.
New
(
"Folder name cannot contain a %"
)
...
@@ -133,23 +134,31 @@ func ActionSelect(cmd *dclish.Command) error {
...
@@ -133,23 +134,31 @@ func ActionSelect(cmd *dclish.Command) error {
fmt
.
Printf
(
"Folder has been set to '%s'.
\n
"
,
folder
.
Name
)
fmt
.
Printf
(
"Folder has been set to '%s'.
\n
"
,
folder
.
Name
)
return
nil
return
nil
}
}
// TODO: Should be:
// WRITE(6,'('' You are not allowed to access folder.'')')
// WRITE(6,'('' See '',A,'' if you wish to access folder.'')')
return
errors
.
New
(
"Unable to select the folder"
)
return
errors
.
New
(
"Unable to select the folder"
)
}
}
// ActionModify handles the `MODIFY` command. This modifies a folder.
// ActionModify handles the `MODIFY` command. This modifies a folder.
// This is based on `MODIFY_FOLDER` in bulletin1.for.
func
ActionModify
(
cmd
*
dclish
.
Command
)
error
{
func
ActionModify
(
cmd
*
dclish
.
Command
)
error
{
if
this
.
User
.
Login
!=
this
.
Folder
.
Owner
&&
this
.
User
.
Admin
==
0
{
if
this
.
User
.
Login
!=
this
.
Folder
.
Owner
&&
this
.
User
.
Admin
==
0
{
return
errors
.
New
(
"Must be folder owner or admin to modify the folder"
)
return
errors
.
New
(
"Must be folder owner or admin to modify the folder"
)
}
}
var
err
error
description
:=
this
.
Folder
.
Description
description
:=
this
.
Folder
.
Description
if
cmd
.
Flags
[
"/DESCRIPTION"
]
.
Set
{
if
cmd
.
Flags
[
"/DESCRIPTION"
]
.
Set
{
description
=
cmd
.
Flags
[
"/DESCRIPTION"
]
.
Value
description
,
err
=
ask
.
GetLine
(
"Enter one line description of folder: "
)
if
err
!=
nil
{
return
err
}
if
len
(
description
)
>
53
{
return
errors
.
New
(
"Description must be < 53 characters"
)
}
}
}
owner
:=
this
.
Folder
.
Owner
owner
:=
this
.
Folder
.
Owner
if
cmd
.
Flags
[
"/OWNER"
]
.
Set
{
if
cmd
.
Flags
[
"/OWNER"
]
.
Set
{
if
this
.
User
.
Admin
==
0
{
return
errors
.
New
(
"Must be an admin to modify the folder owner"
)
}
owner
=
cmd
.
Flags
[
"/OWNER"
]
.
Value
owner
=
cmd
.
Flags
[
"/OWNER"
]
.
Value
}
}
name
:=
this
.
Folder
.
Name
name
:=
this
.
Folder
.
Name
...
@@ -161,7 +170,7 @@ func ActionModify(cmd *dclish.Command) error {
...
@@ -161,7 +170,7 @@ func ActionModify(cmd *dclish.Command) error {
}
}
ctx
:=
storage
.
Context
()
ctx
:=
storage
.
Context
()
err
:
=
this
.
Q
.
UpdateFolderMain
(
ctx
,
storage
.
UpdateFolderMainParams
{
err
=
this
.
Q
.
UpdateFolderMain
(
ctx
,
storage
.
UpdateFolderMainParams
{
Description
:
description
,
Description
:
description
,
Owner
:
owner
,
Owner
:
owner
,
NewName
:
name
,
NewName
:
name
,
...
...
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