+if ($opt_V) {
+ print "Version: $version\n";
+ unless (@ARGV) {
+ print "Upgrade fexget? ";
+ $_ = <STDIN>||'';
+ if (/^y/i) {
+ my $new = `wget -nv -O- http://fex.belwue.de/download/fexget`;
+ if ($new !~ /upgrade fexget/) {
+ die "$0: bad update\n";
+ }
+ system qw'cp -a',$_0,$_0.'_old';
+ exit $? if $?;
+ open $_0,'>',$_0 or die "$0: cannot write $_0. - $!\n";
+ print {$_0} $new;
+ close $_0;
+ exec $_0,qw'-V .';
+ }
+ }
+ exit if "@ARGV" eq '.';
+}
+