From 683d20c31853e99796c3dcd11aa6d19fb7eddb3b Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Mon, 6 Feb 2012 19:59:44 -0500 Subject: [PATCH] Default paths for mosh startup script --- scripts/mosh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/mosh b/scripts/mosh index c0d674a..904fb51 100755 --- a/scripts/mosh +++ b/scripts/mosh @@ -4,14 +4,26 @@ use warnings; use strict; use Socket; use IO::Pty; +use Getopt::Long; $|=1; -if ( scalar @ARGV != 3 ) { - die "Usage: $0 [user@]host mosh-client-command mosh-server-command\n"; +my $client = 'mosh-client'; +my $server = 'mosh-server'; + +my $usage = +qq{Usage: $0 [options] [user@]host + --client=PATH mosh client on local machine (default: "mosh-client") + --server=PATH mosh server on remote machine (default: "mosh-server")\n}; + +GetOptions( 'client=s' => \$client, + 'server=s' => \$server ) or die $usage; + +if ( scalar @ARGV != 1 ) { + die $usage; } -my ( $userhost, $client, $server ) = @ARGV; +my $userhost = $ARGV[ 0 ]; my ( $user, $host );