+use DXCommandmode;
+use DXUser;
+use DXM;
+
+$Spot::spotcachedays = 0;
+$Spot::readback = 0;
+
+
+STDOUT->autoflush(1);
+Spot::init();
+Bands::load();
+Prefix::init();
+DXUser::init(0);
+DXM::load();
+
+my $call = 'N0CALL';
+my $self = bless {_nospawn => 1, width => 80, call=>$call, lang=>'en' }, 'DXCommandmode' ;
+$self->{user} = DXUser::get($call);
+my $wantreal = 0;
+
+while ($ARGV[0] =~ /^-+/) {
+ if ($ARGV[0] =~ /^-+[?h]/i) {
+ help();
+ exit(2);
+ }
+ $wantreal = 1 if $ARGV[0] =~ /^-+r/i;
+ $ve7cc = 1 if $ARGV[0] =~ /^-+v/i;
+ if ($ARGV[0] =~ /^-+w$/i && $ARGV[1] && $ARGV[1] =~ /^\d+$/) {
+ $self->{width} = $ARGV[1];
+ shift @ARGV;
+ }
+ if ($ARGV[0] =~ /^-+c/i && $ARGV[1] && is_callsign(uc $ARGV[1])) {
+ $call = uc $ARGV[1];
+ my $ref = DXUser::get($call);
+ if ($ref) {
+ $self->{call} = $call;
+ $self->{user} = $ref;
+ }
+ shift @ARGV;
+ }
+ $self->{user}->wantgrid(1), ++$wantreal if $self->{user} && $ARGV[0] =~ /^-+(wa|wg)/i;
+ $self->{user}->wantusstate(1), ++$wantreal if $self->{user} && $ARGV[0] =~ /^-+(wa|wu)/i;
+ $self->{user}->wantdxitu(1), ++$wantreal if $self->{user} && $ARGV[0] =~ /^-+(wa|wi)/i;
+ $self->{user}->wantdxcq(1), ++$wantreal if $self->{user} && $ARGV[0] =~ /^-+(wa|wc)/i;
+
+ shift @ARGV;
+}
+
+$self->{ve7cc} = $ve7cc;