Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Wim Lewis
nettle
Commits
aba78308
Commit
aba78308
authored
Oct 22, 2010
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(main): Added long options. Deleted -?, and fixed handling of bad
options. Rev: nettle/examples/nettle-benchmark.c:1.15
parent
f19a068d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
examples/nettle-benchmark.c
examples/nettle-benchmark.c
+15
-3
No files found.
examples/nettle-benchmark.c
View file @
aba78308
...
...
@@ -513,7 +513,16 @@ main(int argc, char **argv)
NULL
};
while
(
(
c
=
getopt
(
argc
,
argv
,
"f:"
))
!=
-
1
)
enum
{
OPT_HELP
=
300
};
static
const
struct
option
options
[]
=
{
/* Name, args, flag, val */
{
"help"
,
no_argument
,
NULL
,
OPT_HELP
},
{
"clock-frequency"
,
required_argument
,
NULL
,
'f'
},
{
NULL
,
0
,
NULL
,
0
}
};
while
(
(
c
=
getopt_long
(
argc
,
argv
,
"f:"
,
options
,
NULL
))
!=
-
1
)
switch
(
c
)
{
case
'f'
:
...
...
@@ -521,8 +530,11 @@ main(int argc, char **argv)
if
(
frequency
>
0
.
0
)
break
;
case
':'
:
case
'?'
:
fprintf
(
stderr
,
"Usage: nettle-benchmark [-f clock frequency] [alg]
\n
"
);
case
OPT_HELP
:
printf
(
"Usage: nettle-benchmark [-f clock frequency] [alg]
\n
"
);
return
EXIT_SUCCESS
;
case
'?'
:
return
EXIT_FAILURE
;
default:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment