Add versions and no-warranty msg to mosh, mosh-client, mosh-server

This commit is contained in:
Keith Winstein
2012-03-12 04:49:00 -04:00
parent 66730050ee
commit 4f8f938369
3 changed files with 30 additions and 1 deletions
+20 -1
View File
@@ -16,6 +16,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
my $MOSH_VERSION = '0.98c';
use warnings; use warnings;
use strict; use strict;
use Socket; use Socket;
@@ -31,6 +33,9 @@ my $predict = undef;
my $port_request = undef; my $port_request = undef;
my $help = undef;
my $version = undef;
my $usage = my $usage =
qq{Usage: $0 [options] [user@]host qq{Usage: $0 [options] [user@]host
--client=PATH mosh client on local machine --client=PATH mosh client on local machine
@@ -44,8 +49,17 @@ qq{Usage: $0 [options] [user@]host
-p NUM --port=NUM server-side UDP port -p NUM --port=NUM server-side UDP port
--help this message
--version
Please report bugs to mosh-devel\@mit.edu. Please report bugs to mosh-devel\@mit.edu.
Mosh home page: http://mosh.mit.edu\n}; Mosh home page: http://mosh.mit.edu
mosh $MOSH_VERSION
Copyright 2012 Keith Winstein <mosh-devel\@mit.edu>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.\n};
sub predict_check { sub predict_check {
my ( $predict, $env_set ) = @_; my ( $predict, $env_set ) = @_;
@@ -65,8 +79,13 @@ GetOptions( 'client=s' => \$client,
'a' => sub { $predict = 'always' }, 'a' => sub { $predict = 'always' },
'n' => sub { $predict = 'never' }, 'n' => sub { $predict = 'never' },
'p=i' => \$port_request, 'p=i' => \$port_request,
'help' => \$help,
'version' => \$version,
'fake-proxy!' => \my $fake_proxy ) or die $usage; 'fake-proxy!' => \my $fake_proxy ) or die $usage;
die $usage if ( defined $help );
die "mosh $MOSH_VERSION\n" if ( defined $version );
if ( defined $predict ) { if ( defined $predict ) {
predict_check( $predict, 0 ); predict_check( $predict, 0 );
} elsif ( defined $ENV{ 'MOSH_PREDICTION_DISPLAY' } ) { } elsif ( defined $ENV{ 'MOSH_PREDICTION_DISPLAY' } ) {
+6
View File
@@ -16,6 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -23,6 +25,10 @@
#include "crypto.h" #include "crypto.h"
void usage( const char *argv0 ) { void usage( const char *argv0 ) {
fprintf( stderr, "mosh-client (%s)\n", PACKAGE_STRING );
fprintf( stderr, "Copyright 2012 Keith Winstein <mosh-devel@mit.edu>\n" );
fprintf( stderr, "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\n" );
fprintf( stderr, "Usage: %s IP PORT\n", argv0 ); fprintf( stderr, "Usage: %s IP PORT\n", argv0 );
} }
+4
View File
@@ -153,6 +153,10 @@ int run_server( const char *desired_ip, const char *desired_port ) {
fprintf( stderr, "[mosh-server detached, pid = %d]\n", (int)getpid() ); fprintf( stderr, "[mosh-server detached, pid = %d]\n", (int)getpid() );
fprintf( stderr, "\nmosh-server (%s)\n", PACKAGE_STRING );
fprintf( stderr, "Copyright 2012 Keith Winstein <mosh-devel@mit.edu>\n" );
fprintf( stderr, "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\n" );
int master; int master;
if ( !(child_termios.c_iflag & IUTF8) ) { if ( !(child_termios.c_iflag & IUTF8) ) {