Commit 1401ce90 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Remove obsolote stuff from the (lengthy) usage message.

Add a limit=N option for controlling how many nodes returned.
parent aa43c008
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group. # Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -20,15 +20,14 @@ my $d = 0; #debug mode ...@@ -20,15 +20,14 @@ my $d = 0; #debug mode
if ($#ARGV >= 0 && $ARGV[0] =~ /^-?h/i ) { if ($#ARGV >= 0 && $ARGV[0] =~ /^-?h/i ) {
die("Usage:\navail [help] [type[=<type>]] [OS[=<OS>]] [ver[=<OS_ver>]]\n". die("Usage:\navail [help] [type[=<type>]] [OS[=<OS>]] [ver[=<OS_ver>]]\n".
" [[includevirt] or [virtonly[=<phys>]]] [rand]\n". " [[includevirt] or [virtonly[=<phys>]]] [rand] [limit=N]".
#" [deltas=<delta[,delta,...]>]". "\n".
# " [fixes=<fix_name[,fix_name,...]>]".
"\n". "\n".
"type \t= pc | shark\n"."OS \t= Linux | FreeBSD | NetBSD | ...\n". "type \t= pc | shark\n"."OS \t= Linux | FreeBSD | NetBSD | ...\n".
"ver \t= 6.2 | 3.4 | 4.0 | 5.2 | ...\n".#"deltas \t= anetd | ...\n". "ver \t= 6.2 | 3.4 | 4.0 | 5.2 | ...\n".#"deltas \t= anetd | ...\n".
"includevirt: Include virtual nodes\n". "includevirt: Include virtual nodes\n".
"rand: Randomize result order\n". "rand: Randomize result order\n".
# "fixes \t\t= cron_off | sendmail_off | ...\n" "limit: Limit count to N nodes\n".
"A field name alone will show that field in the display of available\n". "A field name alone will show that field in the display of available\n".
"nodes. A field name with '=' followed by a string will match nodes\n". "nodes. A field name with '=' followed by a string will match nodes\n".
"that have that string in that field.\n" "that have that string in that field.\n"
...@@ -82,6 +81,12 @@ if ($args{"rand"}) { ...@@ -82,6 +81,12 @@ if ($args{"rand"}) {
$order = "priority"; $order = "priority";
} }
if ($args{"limit"}) {
$limit = "limit " . $args{"limit"};
} else {
$limit = "";
}
my $os = 0; my $os = 0;
my $delta = 0; my $delta = 0;
...@@ -118,7 +123,7 @@ if ($os) { ...@@ -118,7 +123,7 @@ if ($os) {
# } # }
my $cmd = "select $cols from $join where $cond order by $order"; my $cmd = "select $cols from $join where $cond order by $order $limit";
print "Sending cmd:\n$cmd\n" if $d; print "Sending cmd:\n$cmd\n" if $d;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment