Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xflags
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Libraries
Go
Application
xflags
Commits
bb818fdb
Verified
Commit
bb818fdb
authored
Oct 13, 2022
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
refactor the execute function, the execute function should not print messages
parent
55a61783
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
api.go
+2
-20
2 additions, 20 deletions
api.go
with
2 additions
and
20 deletions
api.go
+
2
−
20
View file @
bb818fdb
...
...
@@ -14,32 +14,14 @@ import (
// ExecuteWithShadow executes the command line arguments and calls the functions.
func
ExecuteWithShadow
[
C
any
,
D
any
](
cmd
C
,
cnf
D
)
*
Settings
[
C
]
{
s
:=
execute
(
cmd
,
cnf
,
os
.
Args
[
0
],
os
.
Args
[
1
:
])
if
s
.
HasErrors
()
{
for
_
,
e
:=
range
s
.
Errors
()
{
fmt
.
Println
(
e
)
}
}
return
s
return
execute
(
cmd
,
cnf
,
os
.
Args
[
0
],
os
.
Args
[
1
:
])
}
type
noShadow
struct
{}
// Execute executes the command line arguments and calls the functions.
func
Execute
[
C
any
](
cmd
C
)
*
Settings
[
C
]
{
s
:=
execute
(
cmd
,
noShadow
{},
os
.
Args
[
0
],
os
.
Args
[
1
:
])
if
s
.
HasErrors
()
{
for
_
,
e
:=
range
s
.
Errors
()
{
fmt
.
Println
(
e
)
}
}
if
s
.
hint
!=
""
{
fmt
.
Println
(
s
.
hint
)
}
return
s
return
execute
(
cmd
,
noShadow
{},
os
.
Args
[
0
],
os
.
Args
[
1
:
])
}
func
(
s
*
Settings
[
C
])
PrintFlagOutput
()
{
...
...
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