gnu_stuff.c 2.21 KB
Newer Older
Niels Möller's avatar
Niels Möller committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * @(#) $Id$
 *
 * gnu_stuff.c
 */

/* lsftp, an implementation of the sftp protocol
 *
 * Copyright (C) 2001 Pontus Sköld
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include "gnu_stuff.h"
#include <stdio.h>
Niels Möller's avatar
Niels Möller committed
28
29
#include <stdlib.h>
#include <string.h>
Niels Möller's avatar
Niels Möller committed
30
31
32

void lsftp_welcome()
{
33
  printf( "Welcome to %s %s by Pontus Sköld, Niels Möller and various.\n", PACKAGE, VERSION );
Niels Möller's avatar
Niels Möller committed
34
35
36
37
38
39
40
41
42
  printf( "This program is free software, for more information\n" );
  printf( "please see the file COPYING or type about, you may\n" );
  printf( "also use help or ? to get help.\n\n");
  printf( "Trying to connect, please stand by.\n");

}

void help_option()
{
43
  printf("Usage:\n");
Niels Möller's avatar
Niels Möller committed
44
45
46
47
48
49
  exit(0); /* Exit successfully */
}

void version_option()
{
  printf("%s %s\n", PACKAGE, VERSION);
50
  printf("Copyright (C) Pontus Sköld, Niels Möller and various contributors\n\n");
Niels Möller's avatar
Niels Möller committed
51
52
53
54
55
56
57
58
59
60
61
62

  printf("This program is free software, you may distribute it under the\n");
  printf("terms of the GNU Genereal Public License. \n\n");
  
  printf("This program is distributed in the hope that it will be useful,\n");
  printf("but WITHOUT ANY WARRANTY; without even the implied warranty of\n");
  printf("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n");
  printf("General Public License for more details.\n");

  exit(0); /* Exit successfully */
}

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
void do_gnu_stuff( const char** argv )
{
  const char** current = argv;

  while( *current ) /* More arguments? */
    {
      if( !strcmp( *current, "--version" ) )
	version_option();

      if( !strcmp( *current, "--help" ) )
	help_option();

      current++;
    }
}

Niels Möller's avatar
Niels Möller committed
79