2005-12-21 19:26:05 by steve
Each script now implements a '--version' flag.
This commit is contained in:
@@ -42,7 +42,7 @@ _xen-create-image()
|
||||
_expand || return 0
|
||||
|
||||
# complete using basic options
|
||||
COMPREPLY=( $( compgen -W '--broadcast --boot --debug --dhcp --dir --dist --fs --gateway --help --hostname --ip --manual --memory --network --netmask --mirror --size --swap' -- $cur ) )
|
||||
COMPREPLY=( $( compgen -W '--broadcast --boot --debug --dhcp --dir --dist --fs --gateway --help --hostname --ip --manual --memory --network --netmask --mirror --size --swap --version' -- $cur ) )
|
||||
|
||||
COMPREPLY=( $( echo "${COMP_WORDS[@]}" | \
|
||||
(while read -d ' ' i; do
|
||||
|
||||
@@ -12,6 +12,7 @@ xen-create-image - Create a new Xen instance of Debian Sarge.
|
||||
--debug Show the commandss, and ouptut, which the script creates.
|
||||
--help Show this scripts help information.
|
||||
--manual Read this scripts manual.
|
||||
--version Show the version number and exit.
|
||||
|
||||
Size / General options:
|
||||
--dist Specify the distribution you wish to install: Sarge, Etch, Sid.
|
||||
@@ -100,6 +101,8 @@ suffixed with either Mb, or Gb.
|
||||
Specify the size of the virtual images swap partition. The size may be
|
||||
suffixed with either Mb, or Gb.
|
||||
|
||||
=item B<--version>
|
||||
Show the version number and exit.
|
||||
|
||||
=back
|
||||
|
||||
@@ -230,7 +233,7 @@ suffixed with either Mb, or Gb.
|
||||
--
|
||||
http://www.steve.org.uk/
|
||||
|
||||
$Id: xen-create-image,v 1.49 2005-12-21 19:07:35 steve Exp $
|
||||
$Id: xen-create-image,v 1.50 2005-12-21 19:26:05 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -815,8 +818,9 @@ sub readConfigurationFile
|
||||
|
||||
sub parseCommandLineArguments
|
||||
{
|
||||
my $HELP = 0;
|
||||
my $MANUAL = 0;
|
||||
my $HELP = 0;
|
||||
my $MANUAL = 0;
|
||||
my $VERSION = 0;
|
||||
|
||||
# Parse options.
|
||||
#
|
||||
@@ -839,11 +843,24 @@ sub parseCommandLineArguments
|
||||
"debootstrap=s",\$CONFIG{'debootstrap'},
|
||||
"debug" , \$CONFIG{'debug'},
|
||||
"help", \$HELP,
|
||||
"manual", \$MANUAL
|
||||
"manual", \$MANUAL,
|
||||
"version", \$VERSION
|
||||
);
|
||||
|
||||
pod2usage(1) if $HELP;
|
||||
pod2usage(-verbose => 2 ) if $MANUAL;
|
||||
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Id: xen-create-image,v 1.50 2005-12-21 19:26:05 steve Exp $';
|
||||
$VERSION = join (' ', (split (' ', $REVISION))[2]);
|
||||
$VERSION =~ s/,v\b//;
|
||||
$VERSION =~ s/(\S+)$/$1/;
|
||||
|
||||
print "xen-create-image release 0.5 - CVS: $VERSION\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ xen-delete-image - Delete a previously created Xen instance.
|
||||
Help Options:
|
||||
--help Show help information.
|
||||
--manual Read the manual for this script.
|
||||
--version Show the version information and exit.
|
||||
|
||||
General options:
|
||||
--dir Specify where the output image was saved.
|
||||
@@ -36,6 +37,9 @@ Specify the name of the image to remove.
|
||||
=item B<--manual>
|
||||
Read the manual for this script.
|
||||
|
||||
=item B<--version>
|
||||
Show the version number and exit.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
@@ -61,7 +65,7 @@ Read the manual for this script.
|
||||
--
|
||||
http://www.steve.org.uk/
|
||||
|
||||
$Id: xen-delete-image,v 1.3 2005-12-20 15:57:11 steve Exp $
|
||||
$Id: xen-delete-image,v 1.4 2005-12-21 19:26:05 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -265,8 +269,9 @@ sub readConfigurationFile
|
||||
|
||||
sub parseCommandLineArguments
|
||||
{
|
||||
my $HELP = 0;
|
||||
my $MANUAL = 0;
|
||||
my $HELP = 0;
|
||||
my $MANUAL = 0;
|
||||
my $VERSION = 0;
|
||||
|
||||
# Parse options.
|
||||
#
|
||||
@@ -274,11 +279,25 @@ sub parseCommandLineArguments
|
||||
"hostname=s", \$CONFIG{'hostname'},
|
||||
"dir=s", \$CONFIG{'dir'},
|
||||
"help", \$HELP,
|
||||
"manual", \$MANUAL
|
||||
"manual", \$MANUAL,
|
||||
"version", \$VERSION
|
||||
);
|
||||
|
||||
pod2usage(1) if $HELP;
|
||||
pod2usage(-verbose => 2 ) if $MANUAL;
|
||||
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Id: xen-delete-image,v 1.4 2005-12-21 19:26:05 steve Exp $';
|
||||
$VERSION = join (' ', (split (' ', $REVISION))[2]);
|
||||
$VERSION =~ s/,v\b//;
|
||||
$VERSION =~ s/(\S+)$/$1/;
|
||||
|
||||
print "xen-delete-image release 0.5 - CVS: $VERSION\n";
|
||||
exit;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ xen-duplicate-image - Duplicate an existing Xen instance.
|
||||
Help Options:
|
||||
--help Show this scripts help information.
|
||||
--manual Read this scripts manual.
|
||||
--version Show the version number and exit.
|
||||
|
||||
General options:
|
||||
--dir Specify where the output images should go.
|
||||
@@ -59,6 +60,9 @@ Specify the network the virtual image is living upon. Only useful if DHCP is no
|
||||
=item B<--from>
|
||||
Specify the virtual instance that we should copy.
|
||||
|
||||
=item B<--version>
|
||||
Show the version number and exit.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
@@ -103,7 +107,7 @@ Specify the virtual instance that we should copy.
|
||||
--
|
||||
http://www.steve.org.uk/
|
||||
|
||||
$Id: xen-duplicate-image,v 1.6 2005-12-20 14:35:09 steve Exp $
|
||||
$Id: xen-duplicate-image,v 1.7 2005-12-21 19:26:05 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -400,8 +404,9 @@ sub readConfigurationFile
|
||||
|
||||
sub parseCommandLineArguments
|
||||
{
|
||||
my $HELP = 0;
|
||||
my $MANUAL = 0;
|
||||
my $HELP = 0;
|
||||
my $MANUAL = 0;
|
||||
my $VERSION = 0;
|
||||
|
||||
# Parse options.
|
||||
#
|
||||
@@ -416,11 +421,25 @@ sub parseCommandLineArguments
|
||||
"dir=s", \$CONFIG{'dir'},
|
||||
"dhcp", \$CONFIG{'dhcp'},
|
||||
"help", \$HELP,
|
||||
"manual", \$MANUAL
|
||||
"manual", \$MANUAL,
|
||||
"version", \$VERSION
|
||||
);
|
||||
|
||||
pod2usage(1) if $HELP;
|
||||
pod2usage(-verbose => 2 ) if $MANUAL;
|
||||
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Id: xen-duplicate-image,v 1.7 2005-12-21 19:26:05 steve Exp $';
|
||||
$VERSION = join (' ', (split (' ', $REVISION))[2]);
|
||||
$VERSION =~ s/,v\b//;
|
||||
$VERSION =~ s/(\S+)$/$1/;
|
||||
|
||||
print "xen-duplicate-image release 0.5 - CVS: $VERSION\n";
|
||||
exit;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ xen-list-images - List all the created and configured Xen images.
|
||||
Help Options:
|
||||
--help Show this scripts help information.
|
||||
--manual Read this scripts manual.
|
||||
--version Show the version number and exit.
|
||||
|
||||
General Options:
|
||||
--dir Specify where the output images are located.
|
||||
@@ -25,10 +26,13 @@ xen-list-images - List all the created and configured Xen images.
|
||||
Specify the output directory where images were saved.
|
||||
|
||||
=item B<--help>
|
||||
Show the script help
|
||||
Show the scripts help information.
|
||||
|
||||
=item B<--manual>
|
||||
Read the manual
|
||||
Read the manual.
|
||||
|
||||
=item B<--version>
|
||||
Show the version number and exit.
|
||||
|
||||
=back
|
||||
|
||||
@@ -69,7 +73,7 @@ Read the manual
|
||||
--
|
||||
http://www.steve.org.uk/
|
||||
|
||||
$Id: xen-list-images,v 1.4 2005-12-20 14:35:09 steve Exp $
|
||||
$Id: xen-list-images,v 1.5 2005-12-21 19:26:05 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -280,19 +284,34 @@ sub readConfigurationFile
|
||||
|
||||
sub parseCommandLineArguments
|
||||
{
|
||||
my $HELP = 0;
|
||||
my $MANUAL = 0;
|
||||
my $HELP = 0;
|
||||
my $MANUAL = 0;
|
||||
my $VERSION = 0;
|
||||
|
||||
# Parse options.
|
||||
#
|
||||
GetOptions(
|
||||
"dir=s", \$CONFIG{'dir'},
|
||||
"help", \$HELP,
|
||||
"manual", \$MANUAL
|
||||
"manual", \$MANUAL,
|
||||
"version", \$VERSION
|
||||
);
|
||||
|
||||
pod2usage(1) if $HELP;
|
||||
pod2usage(-verbose => 2 ) if $MANUAL;
|
||||
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Id: xen-list-images,v 1.5 2005-12-21 19:26:05 steve Exp $';
|
||||
$VERSION = join (' ', (split (' ', $REVISION))[2]);
|
||||
$VERSION =~ s/,v\b//;
|
||||
$VERSION =~ s/(\S+)$/$1/;
|
||||
|
||||
print "xen-list-images release 0.5 - CVS: $VERSION\n";
|
||||
exit;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ xen-update-image - Update the software installed upon the given image.
|
||||
Help Options:
|
||||
--help Show this scripts help information.
|
||||
--manual Read this scripts manual.
|
||||
--version Show the version number and exit.
|
||||
|
||||
General Options:
|
||||
--dir Specify where the output image was saved.
|
||||
@@ -36,6 +37,8 @@ Specify the name of the image to remove.
|
||||
=item B<--manual>
|
||||
Read the manual
|
||||
|
||||
=item B<--version>
|
||||
Show the version number and exit.
|
||||
|
||||
|
||||
=back
|
||||
@@ -69,7 +72,7 @@ Read the manual
|
||||
--
|
||||
http://www.steve.org.uk/
|
||||
|
||||
$Id: xen-update-image,v 1.3 2005-12-20 14:35:09 steve Exp $
|
||||
$Id: xen-update-image,v 1.4 2005-12-21 19:26:05 steve Exp $
|
||||
|
||||
=cut
|
||||
|
||||
@@ -234,8 +237,9 @@ sub readConfigurationFile
|
||||
|
||||
sub parseCommandLineArguments
|
||||
{
|
||||
my $HELP = 0;
|
||||
my $MANUAL = 0;
|
||||
my $HELP = 0;
|
||||
my $MANUAL = 0;
|
||||
my $VERSION = 0;
|
||||
|
||||
# Parse options.
|
||||
#
|
||||
@@ -243,11 +247,24 @@ sub parseCommandLineArguments
|
||||
"hostname=s", \$CONFIG{'hostname'},
|
||||
"dir=s", \$CONFIG{'dir'},
|
||||
"help", \$HELP,
|
||||
"manual", \$MANUAL
|
||||
"manual", \$MANUAL,
|
||||
"version", \$VERSION
|
||||
);
|
||||
|
||||
pod2usage(1) if $HELP;
|
||||
pod2usage(-verbose => 2 ) if $MANUAL;
|
||||
|
||||
if ( $VERSION )
|
||||
{
|
||||
my $REVISION = '$Id: xen-update-image,v 1.4 2005-12-21 19:26:05 steve Exp $';
|
||||
$VERSION = join (' ', (split (' ', $REVISION))[2]);
|
||||
$VERSION =~ s/,v\b//;
|
||||
$VERSION =~ s/(\S+)$/$1/;
|
||||
|
||||
print "xen-update-image release 0.5 - CVS: $VERSION\n";
|
||||
exit;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user