Skip to content

Commit

Permalink
[mosh] Perform command line initialisation as early as possible
Browse files Browse the repository at this point in the history
mobile-shell#431

Move command line initialisation before considering any of the command line
options to simplify subsequent configuration file operations.

Signed-off-by: Earl Chew <[email protected]>
  • Loading branch information
earlchew committed Apr 5, 2018
1 parent d7abea5 commit 2abc10a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/mosh
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,13 @@ if ( ! defined $fake_proxy ) {
exit;
}

if ( scalar @ARGV < 1 ) {
die $usage;
}

my $userhost = shift;
my @command = @ARGV;

if ( defined $predict ) {
predict_check( $predict, 0 );
} elsif ( defined $ENV{ 'MOSH_PREDICTION_DISPLAY' } ) {
Expand Down Expand Up @@ -713,13 +720,6 @@ if ( not defined $bind_ip or $bind_ip =~ m{^ssh$}i ) {
die $usage;
}

if ( scalar @ARGV < 1 ) {
die $usage;
}

my $userhost = shift;
my @command = @ARGV;

# Count colors
open COLORCOUNT, '-|', $client, ('-c') or die "Can't count colors: $!\n";
my $colors = "";
Expand Down

0 comments on commit 2abc10a

Please sign in to comment.