-Support putting hostnames field before nodename and such if -h//--hostnamesfirst is given to makehosts
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4910 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
6971824f19
commit
93e6b3cf34
@ -10,6 +10,7 @@ use Getopt::Long;
|
||||
|
||||
my @hosts; #Hold /etc/hosts data to be written back
|
||||
my $LONGNAME;
|
||||
my $OTHERNAMESFIRST;
|
||||
|
||||
|
||||
my %usage=(
|
||||
@ -79,6 +80,7 @@ sub build_line {
|
||||
|
||||
$othernames=join(' ', @o_names);
|
||||
if ($LONGNAME) { return "$ip $longname $node $othernames\n"; }
|
||||
elsif ($OTHERNAMESFIRST) { return "$ip $othernames $node $longname\n"; }
|
||||
else { return "$ip $node $longname $othernames\n"; }
|
||||
}
|
||||
|
||||
@ -116,6 +118,7 @@ sub process_request {
|
||||
if(!GetOptions(
|
||||
'h|help' => \$HELP,
|
||||
'n' => \$REMOVE,
|
||||
'h|hostnamesfirst' => \$OTHERNAMESFIRST,
|
||||
'l|longnamefirst' => \$LONGNAME,))
|
||||
{
|
||||
$callback->({data=>$usage{makehosts}});
|
||||
|
Loading…
Reference in New Issue
Block a user