Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
e4715f00
Commit
e4715f00
authored
Jul 11, 2011
by
antirez
Browse files
--help implemented
parent
121ffc85
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_helper.tcl
View file @
e4715f00
...
@@ -312,6 +312,17 @@ proc send_data_packet {fd status data} {
...
@@ -312,6 +312,17 @@ proc send_data_packet {fd status data} {
flush $fd
flush $fd
}
}
proc print_help_screen
{}
{
puts
[
join
{
"--valgrind Run the test over valgrind."
"--accurate Run slow randomized tests for more iterations."
"--single <unit> Just execute the specified unit (see next option)."
"--list-tests List all the available test units."
"--force-failure Force the execution of a test that always fails."
"--help Print this help screen."
}
"
\n
"
]
}
# parse arguments
# parse arguments
for
{
set j 0
}
{
$j
<
[
llength $argv
]}
{
incr j
}
{
for
{
set j 0
}
{
$j
<
[
llength $argv
]}
{
incr j
}
{
set opt
[
lindex $argv $j
]
set opt
[
lindex $argv $j
]
...
@@ -327,9 +338,6 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
...
@@ -327,9 +338,6 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
incr j
incr j
}
elseif
{
$opt
eq
{
--valgrind
}}
{
}
elseif
{
$opt
eq
{
--valgrind
}}
{
set ::valgrind 1
set ::valgrind 1
}
elseif
{
$opt
eq
{
--file
}}
{
set ::file $arg
incr j
}
elseif
{
$opt
eq
{
--host
}}
{
}
elseif
{
$opt
eq
{
--host
}}
{
set ::external 1
set ::external 1
set ::host $arg
set ::host $arg
...
@@ -337,8 +345,6 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
...
@@ -337,8 +345,6 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
}
elseif
{
$opt
eq
{
--port
}}
{
}
elseif
{
$opt
eq
{
--port
}}
{
set ::port $arg
set ::port $arg
incr j
incr j
}
elseif
{
$opt
eq
{
--verbose
}}
{
set ::verbose 1
}
elseif
{
$opt
eq
{
--accurate
}}
{
}
elseif
{
$opt
eq
{
--accurate
}}
{
set ::accurate 1
set ::accurate 1
}
elseif
{
$opt
eq
{
--force-failure
}}
{
}
elseif
{
$opt
eq
{
--force-failure
}}
{
...
@@ -356,7 +362,7 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
...
@@ -356,7 +362,7 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
set ::test_server_port $arg
set ::test_server_port $arg
incr j
incr j
}
elseif
{
$opt
eq
{
--help
}}
{
}
elseif
{
$opt
eq
{
--help
}}
{
p
uts
"TODO print an
help
screen
"
p
rint_
help
_
screen
exit 0
exit 0
}
else
{
}
else
{
puts
"Wrong argument:
$opt
"
puts
"Wrong argument:
$opt
"
...
...
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