mdirs: add -0 to separate folders by NUL characters

Idea by Mario Domgoergen <mdom@taz.de>.

Closes #159.
pull/163/head
Leah Neukirchen 5 years ago
parent 085138d6a2
commit f8fa6a1e0e

@ -6,6 +6,7 @@
.Nd list maildir folders, recursively
.Sh SYNOPSIS
.Nm
.Op Fl 0
.Ar dirs\ ...
.Sh DESCRIPTION
.Nm
@ -27,7 +28,11 @@ By the maildir++ convention, nested maildir folder
names must begin with
.Sq Li \&. .
.Pp
There are currently no options.
The options are as follows:
.Bl -tag -width Ds
.It Fl 0
Print folders separated by a NUL character.
.El
.Sh EXIT STATUS
.Ex -std
.Sh SEE ALSO

@ -9,12 +9,14 @@
#include "blaze822.h"
static char sep = '\n';
void
pwd()
{
char cwd[PATH_MAX];
if (getcwd(cwd, sizeof cwd))
puts(cwd);
printf("%s%c", cwd, sep);
}
void
@ -72,11 +74,12 @@ int
main(int argc, char *argv[])
{
int c, i;
while ((c = getopt(argc, argv, "")) != -1)
while ((c = getopt(argc, argv, "0")) != -1)
switch (c) {
case '0': sep = '\0'; break;
default:
usage:
fprintf(stderr, "Usage: mdirs dirs...\n");
fprintf(stderr, "Usage: mdirs [-0] dirs...\n");
exit(1);
}

Loading…
Cancel
Save