Skip to content

Instantly share code, notes, and snippets.

@alexm
Created February 6, 2012 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexm/1755855 to your computer and use it in GitHub Desktop.
Save alexm/1755855 to your computer and use it in GitHub Desktop.
sub opt_postinstalls {
print "\nValid Postinstalls\n";
print "------------------\n\n";
list_postinstall();
print "\n";
exit 0
}
sub opt_distros {
print "\nValid Distributions\n";
print "-------------------\n\n";
list_distros();
print "\n";
exit 0
}
sub opt_vlans {
print "\Valid Vlans\n";
print "---------------\n\n";
print Dumper $vlans;
exit 0
}
my $opt_discs = sub {
print "\nValid Discs\n";
print "---------------\n\n";
print Dumper $discs;
exit 0
};
my $opt_partitions = sub {
print "\nValid Partitions\n";
print "---------------\n\n";
print Dumper $partitions;
exit 0
};
GetOptions (
# referències a funcions
'postintalls|P' => \&opt_postinstalls,
'distros|D' => \&opt_distros,
'vlans|V' => \&opt_vlans,
# clausures
'discs|d' => $opt_discs,
'partitions|p' => $opt_partitions,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment