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
3c3b9d84
...
3c3b9d84ecdf6a814ee1adbe82db5be56dfd1696
authored
2001-03-13 04:23:25 +0000
by
Alain Magloire
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
frm.c : support for --field
1 parent
ce99e4e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
frm/frm.c
frm/frm.c
View file @
3c3b9d8
...
...
@@ -38,6 +38,7 @@ static int counter;
static
struct
option
long_options
[]
=
{
{
"help"
,
no_argument
,
0
,
'h'
},
{
"field"
,
required_argument
,
0
,
'f'
},
{
"to"
,
no_argument
,
0
,
'l'
},
{
"number"
,
no_argument
,
0
,
'n'
},
{
"Quiet"
,
no_argument
,
0
,
'Q'
},
...
...
@@ -49,8 +50,9 @@ static struct option long_options[] =
{
0
,
0
,
0
,
0
}
};
const
char
*
short_options
=
"hlnQqSs:tv"
;
const
char
*
short_options
=
"h
f:
lnQqSs:tv"
;
static
char
*
show_field
;
static
int
show_to
;
static
int
show_from
=
1
;
static
int
show_subject
=
1
;
...
...
@@ -108,7 +110,6 @@ action (observer_t o, size_t type)
message_t
msg
=
NULL
;
header_t
hdr
=
NULL
;
attribute_t
attr
=
NULL
;
char
hsubject
[
512
];
counter
++
;
...
...
@@ -145,6 +146,15 @@ action (observer_t o, size_t type)
if
(
show_number
)
printf
(
"%d: "
,
counter
);
if
(
show_field
)
{
char
hfield
[
256
];
int
status
=
header_get_value
(
hdr
,
show_field
,
hfield
,
sizeof
(
hfield
),
NULL
);
if
(
status
==
0
)
printf
(
"%s
\n
"
,
hfield
);
}
if
(
show_to
)
{
char
hto
[
16
];
...
...
@@ -171,6 +181,7 @@ action (observer_t o, size_t type)
char
hsubject
[
64
];
int
status
=
header_get_value
(
hdr
,
MU_HEADER_SUBJECT
,
hsubject
,
sizeof
(
hsubject
),
NULL
);
if
(
status
==
0
)
printf
(
"%s
\n
"
,
hsubject
);
}
break
;
...
...
@@ -189,8 +200,9 @@ usage (const char *argv)
printf
(
"GNU Mailutils.
\n
"
);
printf
(
"Usage: %s [OPTIONS]
\n\n
"
,
argv
);
printf
(
" -h, --help display this help and exit
\n
"
);
printf
(
" -f, --field=string header field to display
\n
"
);
printf
(
" -l, --to include the To: information
\n
"
);
printf
(
" -n, --number display the message numberd
\n
"
);
printf
(
" -n, --number display the message number
e
d
\n
"
);
printf
(
" -Q, --Quiet very quiet
\n
"
);
printf
(
" -q, --query print a message if unread mail
\n
"
);
printf
(
" -S, --summary print a summary of messages
\n
"
);
...
...
@@ -227,6 +239,13 @@ main(int argc, char **argv)
usage
(
argv
[
0
]);
break
;
case
'f'
:
show_field
=
optarg
;
show_from
=
0
;
show_subject
=
0
;
align
=
0
;
break
;
case
'l'
:
show_to
=
1
;
break
;
...
...
Please
register
or
sign in
to post a comment