Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
6
66
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Eric Vidal
66
Commits
cf244f36
Commit
cf244f36
authored
6 years ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
66-all: add -t option, only start/stop the given tree instead of all tree
parent
d29a23e2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/66/66-all.c
+19
-9
19 additions, 9 deletions
src/66/66-all.c
with
19 additions
and
9 deletions
src/66/66-all.c
+
19
−
9
View file @
cf244f36
...
...
@@ -43,18 +43,19 @@
unsigned
int
VERBOSITY
=
1
;
static
tain_t
DEADLINE
;
unsigned
int
trc
=
0
;
#define USAGE "66-all [ -h help ] [ -v verbosity ] [ -T timeout ] [ -l live ] up/down"
#define USAGE "66-all [ -h help ] [ -v verbosity ] [ -T timeout ] [ -l live ]
[ -t tree ]
up/down"
static
inline
void
info_help
(
void
)
{
static
char
const
*
help
=
"66-all <options>
tree
\n
"
"66-all <options>
up/down
\n
"
"
\n
"
"options :
\n
"
" -h: print this help
\n
"
" -v: increase/decrease verbosity
\n
"
" -T: timeout
\n
"
" -l: live directory
\n
"
" -t: tree to use
\n
"
;
if
(
buffer_putsflush
(
buffer_1
,
help
)
<
0
)
...
...
@@ -109,6 +110,7 @@ int doit(char const *tree,char const *treename,char const *live, unsigned int wh
{
VERBO3
strerr_warni4x
(
"no classic service for tree: "
,
treename
,
" to "
,
what
?
"start"
:
"stop"
)
;
}
/** add transparent Master to start the db*/
if
(
!
stra_add
(
&
ga
,
"Master"
))
{
VERBO3
strerr_warnwu2x
(
"add Master as service to "
,
what
?
"start"
:
"stop"
)
;
...
...
@@ -175,6 +177,8 @@ int main(int argc, char const *const *argv,char const *const *envp)
unsigned
int
tmain
=
0
;
uid_t
owner
;
char
const
*
treename
=
NULL
;
stralloc
base
=
STRALLOC_ZERO
;
stralloc
scandir
=
STRALLOC_ZERO
;
stralloc
livetree
=
STRALLOC_ZERO
;
...
...
@@ -191,7 +195,7 @@ int main(int argc, char const *const *argv,char const *const *envp)
for
(;;)
{
int
opt
=
getopt_args
(
argc
,
argv
,
">hv:l:
t:T
:"
,
&
l
)
;
int
opt
=
getopt_args
(
argc
,
argv
,
">hv:l:
T:t
:"
,
&
l
)
;
if
(
opt
==
-
1
)
break
;
if
(
opt
==
-
2
)
strerr_dief1x
(
110
,
"options must be set first"
)
;
switch
(
opt
)
...
...
@@ -202,9 +206,7 @@ int main(int argc, char const *const *argv,char const *const *envp)
if
(
!
stralloc_0
(
&
live
))
retstralloc
(
111
,
"main"
)
;
break
;
case
'T'
:
if
(
!
uint0_scan
(
l
.
arg
,
&
tmain
))
exitusage
()
;
break
;
case
't'
:
if
(
!
stralloc_cats
(
&
tree
,
l
.
arg
))
retstralloc
(
111
,
"main"
)
;
if
(
!
stralloc_0
(
&
tree
))
retstralloc
(
111
,
"main"
)
;
break
;
case
't'
:
treename
=
l
.
arg
;
break
;
default
:
exitusage
()
;
}
}
...
...
@@ -268,9 +270,17 @@ int main(int argc, char const *const *argv,char const *const *envp)
/** ensure that we have an empty line at the end of the string*/
if
(
!
stralloc_cats
(
&
contents
,
"
\n
"
))
retstralloc
(
111
,
"main"
)
;
if
(
!
stralloc_0
(
&
contents
))
retstralloc
(
111
,
"main"
)
;
if
(
!
clean_val
(
&
in
,
contents
.
s
))
strerr_diefu2x
(
111
,
"clean: "
,
contents
.
s
)
;
/** only one tree?*/
if
(
treename
)
{
if
(
!
stra_add
(
&
in
,
treename
))
strerr_diefu3x
(
111
,
"add: "
,
treename
,
" as tree to start"
)
;
}
else
{
if
(
!
clean_val
(
&
in
,
contents
.
s
))
strerr_diefu2x
(
111
,
"clean: "
,
contents
.
s
)
;
}
if
(
!
in
.
len
)
{
...
...
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