Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
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
Container 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
core
tarantool
Commits
63e47e55
Commit
63e47e55
authored
11 years ago
by
Eugine Blikh
Browse files
Options
Downloads
Patches
Plain Diff
#103: move -V to -W and -v to -V
parent
e1d67553
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
client/tarancheck/tc_main.c
+3
-1
3 additions, 1 deletion
client/tarancheck/tc_main.c
client/tarancheck/tc_options.c
+13
-5
13 additions, 5 deletions
client/tarancheck/tc_options.c
client/tarancheck/tc_options.h
+4
-0
4 additions, 0 deletions
client/tarancheck/tc_options.h
with
20 additions
and
6 deletions
client/tarancheck/tc_main.c
+
3
−
1
View file @
63e47e55
...
...
@@ -72,8 +72,10 @@ int main(int argc, char *argv[])
switch
(
mode
)
{
case
TC_MODE_USAGE
:
return
tc_options_usage
();
break
;
case
TC_MODE_VERSION
:
return
0
;
return
tc_options_version
();
break
;
case
TC_MODE_VERIFY
:
rc
=
tc_config_load
(
&
opts
);
if
(
rc
==
-
1
)
...
...
This diff is collapsed.
Click to expand it.
client/tarancheck/tc_options.c
+
13
−
5
View file @
63e47e55
...
...
@@ -44,11 +44,11 @@
static
const
void
*
opts_def
=
gopt_start
(
gopt_option
(
'G'
,
GOPT_ARG
,
gopt_shorts
(
'G'
),
gopt_longs
(
"generate"
),
" <file>"
,
"generate signature file"
),
gopt_option
(
'
V
'
,
GOPT_ARG
,
gopt_shorts
(
'
V
'
),
gopt_option
(
'
W
'
,
GOPT_ARG
,
gopt_shorts
(
'
W
'
),
gopt_longs
(
"verify"
),
" <file>"
,
"verify signature file"
),
gopt_option
(
'?'
,
0
,
gopt_shorts
(
0
),
gopt_longs
(
"help"
),
NULL
,
"display this help and exit"
),
gopt_option
(
'
v
'
,
0
,
gopt_shorts
(
'
v
'
),
gopt_longs
(
"version"
),
gopt_option
(
'
V
'
,
0
,
gopt_shorts
(
'
V
'
),
gopt_longs
(
"version"
),
NULL
,
"display version information and exit"
)
);
...
...
@@ -69,17 +69,25 @@ int tc_options_usage(void)
return
1
;
}
int
tc_options_version
(
void
)
{
printf
(
"tarancheck client, version %s.%s
\n
"
,
TC_VERSION_MAJOR
,
TC_VERSION_MINOR
);
return
1
;
}
enum
tc_options_mode
tc_options_process
(
struct
tc_options
*
opts
,
int
argc
,
char
**
argv
)
{
void
*
opt
=
gopt_sort
(
&
argc
,
(
const
char
**
)
argv
,
opts_def
);
/* usage */
if
(
gopt
(
opt
,
'?'
)
||
argc
!=
2
)
{
if
(
gopt
(
opt
,
'?'
))
{
opts
->
mode
=
TC_MODE_USAGE
;
goto
done
;
}
/* version */
if
(
gopt
(
opt
,
'
v
'
))
{
if
(
gopt
(
opt
,
'
V
'
))
{
opts
->
mode
=
TC_MODE_VERSION
;
goto
done
;
}
...
...
@@ -87,7 +95,7 @@ tc_options_process(struct tc_options *opts, int argc, char **argv)
if
(
gopt_arg
(
opt
,
'G'
,
&
opts
->
file
))
{
opts
->
mode
=
TC_MODE_GENERATE
;
}
else
if
(
gopt_arg
(
opt
,
'
V
'
,
&
opts
->
file
))
{
if
(
gopt_arg
(
opt
,
'
W
'
,
&
opts
->
file
))
{
opts
->
mode
=
TC_MODE_VERIFY
;
}
else
{
opts
->
mode
=
TC_MODE_USAGE
;
...
...
This diff is collapsed.
Click to expand it.
client/tarancheck/tc_options.h
+
4
−
0
View file @
63e47e55
...
...
@@ -8,6 +8,9 @@ enum tc_options_mode {
TC_MODE_VERIFY
};
#define TC_VERSION_MINOR "1"
#define TC_VERSION_MAJOR "0"
struct
tc_options
{
enum
tc_options_mode
mode
;
const
char
*
file
;
...
...
@@ -20,5 +23,6 @@ void tc_options_free(struct tc_options *opts);
enum
tc_options_mode
tc_options_process
(
struct
tc_options
*
opts
,
int
argc
,
char
**
argv
);
int
tc_options_usage
(
void
);
int
tc_options_version
(
void
);
#endif
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