Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
7d210b49
...
7d210b4993b69d06e42e555dafd13090a994909a
authored
1999-10-04 02:02:47 +0000
by
Jeff Bailey
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Support --mail and --version in mail
1 parent
dddb3013
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
6 deletions
ChangeLog
mail/Makefile.am
mail/mail.c
ChangeLog
View file @
7d210b4
1999-10-03 Jeff Bailey <jbailey@cr499794-a.crdva1.bc.wave.home.com>
* mail/mail.c: Support --help, --version.
* mail/Makefile.am: Add -Wall to compile line.
* libmailbox/Makefile.am: Add -Wall to compile line.
...
...
mail/Makefile.am
View file @
7d210b4
CPPFLAGS
=
-I
$(top_srcdir)
/libmailbox -Wall
CPPFLAGS
=
-I
$(top_srcdir)
/libmailbox -Wall
-pedantic
bin_PROGRAMS
=
mail
...
...
mail/mail.c
View file @
7d210b4
...
...
@@ -22,6 +22,9 @@
#include <mailbox.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <getopt.h>
#ifdef HAVE_PATHS_H
#include <paths.h>
...
...
@@ -31,21 +34,47 @@
#define _PATH_MAILDIR "/var/spool/mail"
#endif
static
struct
option
long_options
[]
=
{
{
"help"
,
0
,
NULL
,
'h'
},
{
"version"
,
0
,
NULL
,
'v'
},
{
NULL
,
0
,
NULL
,
0
}
};
int
main
(
int
argc
,
char
**
argv
)
{
char
*
foo
,
bar
[
80
];
int
i
=
0
;
char
c
=
0
;
char
*
mboxname
;
mailbox
*
mbox
;
char
*
mboxname
=
0
;
mailbox
*
mbox
=
0
;
i
=
getopt_long
(
argc
,
argv
,
"hv"
,
long_options
,
(
int
*
)
0
);
if
(
argc
!=
1
)
switch
(
i
)
{
fprintf
(
stderr
,
"Usage: %s
\n
"
,
argv
[
0
]);
return
1
;
case
'v'
:
printf
(
"mail (GNU mailutils) %s
\n
"
,
VERSION
);
exit
(
0
);
break
;
case
'h'
:
printf
(
"\
Usage: mail [OPTION]...
\n
\
Access the current users mailbox through a simple text mode interface
\n
\
\n
\
--version Show version information
\n
\
--help Show this message
\n
\
\n
\
Report bugs to <bug-mailutils@gnu.org>.
\n
"
);
exit
(
0
);
break
;
default:
break
;
}
mboxname
=
getenv
(
"MAIL"
);
if
(
mboxname
==
NULL
)
{
...
...
Please
register
or
sign in
to post a comment