Skip to content

Instantly share code, notes, and snippets.

@oinume
Created April 10, 2010 04:24
Show Gist options
  • Save oinume/361819 to your computer and use it in GitHub Desktop.
Save oinume/361819 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Compact;
use Data::Dumper;
my $getopt = Getopt::Compact->new(
name => 'mygzip',
modes => [ qw(verbose) ],
args => 'FILE',
version => '0.1',
struct => [
[ [ qw(f force) ], 'force overwrite of output file and compress links' ],
[ [ qw(l level) ], 'compress level', '=i' ],
[ [ qw(S suffix) ], 'use suffix on compressed files', '=s' ],
]
);
my $options = $getopt->opts;
my $file = shift @ARGV;
unless ($file) {
print STDERR $getopt->usage;
exit 1;
}
print "options -----\n";
print Dumper $options;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment