use Getopt::Long qw(:config permute);
my $syslog = 0;
my $logmin = "notice";
my $dsn = "dbi:Pg:dbname=weather";
my $dbuser = "";
my $dbpass = "";
my $device = "/dev/ttyUSB0";
my $get_model = 0;
my $get_version = 0;
my $imperial = 0;
my $set_time = 0;
my $get_time = 0;
my $dump = undef;
my $backlight = undef;
my $loopfor = undef;
my $template = undef;
my $stream = undef;
my $interval = undef;
my $command = undef;
my $helpmeplease = 0;
GetOptions ('debug!' => \$debug,
'syslog!' => \$syslog,
'model!' => \$get_model,
'version!' => \$get_version,
'logmin=s' => \$logmin,
'dsn=s' => \$dsn,
'dbuser=s' => \$dbuser,
'dbpass=s' => \$dbpass,
'device=s' => \$device,
'imperial' => \$imperial,
'gettime!' => \$get_time,
'settime' => \$set_time,
'backlight=s' => \$backlight,
'template=s' => \$template,
'command=s' => \$command,
'loopfor=i' => \$loopfor,
'stream=i' => \$stream,
'interval=i' => \$interval,
'dump:s' => \$dump,
'help' => \$helpmeplease );
use Getopt::Long qw(GetOptions);
my %opt = (
logmin => "notice",
dsn => "dbi:Pg:dbname=weather",
device => "/dev/ttyUSB0",
);
GetOptions(
\%opt,
'debug!',
'syslog!',
'model!',
'version!',
'logmin=s',
'dsn=s',
'dbuser=s',
'dbpass=s',
'device=s',
'imperial',
'gettime!',
'settime',
'backlight=s',
'template=s',
'command=s',
'loopfor=i',
'stream=i',
'interval=i',
'dump:s',
'help',
);