Browse Source
Add manpage generation
Add manpage generation
Forked `structopt-derive` to https://github.com/epilys/structopt-derive-manpagemain
12 changed files with 506 additions and 8 deletions
-
10Cargo.lock
-
3Cargo.toml
-
43cli/build.rs
-
8cli/src/main.rs
-
54docs/command.mdoc
-
28docs/error_queue.mdoc
-
2docs/footer.mdoc
-
6docs/header.mdoc
-
104docs/list.mdoc
-
224docs/mailpot.1
-
14docs/mailpot.1.m4
-
18docs/main.mdoc
@ -0,0 +1,43 @@ |
|||
/*
|
|||
* This file is part of mailpot
|
|||
*
|
|||
* Copyright 2020 - Manos Pitsidianakis
|
|||
*
|
|||
* This program is free software: you can redistribute it and/or modify
|
|||
* it under the terms of the GNU Affero General Public License as
|
|||
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
|||
*
|
|||
* You should have received a copy of the GNU Affero General Public License
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||
*/
|
|||
|
|||
use std::io::Write;
|
|||
use std::process::Command;
|
|||
|
|||
fn main() {
|
|||
println!("cargo:rerun-if-changed=../docs/command.mdoc");
|
|||
println!("cargo:rerun-if-changed=../docs/list.mdoc");
|
|||
println!("cargo:rerun-if-changed=../docs/error_queue.mdoc");
|
|||
println!("cargo:rerun-if-changed=../docs/main.mdoc");
|
|||
println!("cargo:rerun-if-changed=../docs/header.mdoc");
|
|||
println!("cargo:rerun-if-changed=../docs/footer.mdoc");
|
|||
println!("cargo:rerun-if-changed=../docs/mailpot.1.m4");
|
|||
println!("cargo:rerun-if-changed=../docs/mailpot.1");
|
|||
println!("cargo:rerun-if-changed=../docs");
|
|||
println!("cargo:rerun-if-changed=./src/main.rs");
|
|||
println!("build running");
|
|||
std::env::set_current_dir("..").expect("could not chdir('..')");
|
|||
|
|||
let output = Command::new("m4")
|
|||
.arg("./docs/mailpot.1.m4")
|
|||
.output()
|
|||
.unwrap();
|
|||
let mut file = std::fs::File::create("./docs/mailpot.1").unwrap();
|
|||
file.write_all(&output.stdout).unwrap();
|
|||
}
|
@ -0,0 +1,54 @@ |
|||
|
|||
.Bl -tag -width Ds -compact -offset indent |
|||
.It Ic db-location |
|||
Prints database filesystem location. |
|||
.It Ic config-location |
|||
Prints default configuration file filesystem location. |
|||
.It Ic dump-database |
|||
Dumps database data to STDOUT. |
|||
.It Ic list-lists |
|||
Lists all registered mailing lists. |
|||
.It Ic list |
|||
Mailing list management. |
|||
.It Ic create-list |
|||
.Fl -name Ar name |
|||
List name. |
|||
|
|||
.Fl -id Ar id |
|||
List ID. |
|||
|
|||
.Fl -address Ar address |
|||
List e-mail address. |
|||
|
|||
.Fl -description Ar description |
|||
List description. |
|||
|
|||
.Fl -archive-url Ar archive-url |
|||
List archive URL. |
|||
|
|||
Create new list. |
|||
.It Ic post |
|||
.Fl -dry-run |
|||
. |
|||
|
|||
Post message from STDIN to list. |
|||
.It Ic error-queue |
|||
Mail that has not been handled properly end up in the error queue. |
|||
.It Ic db-location |
|||
Prints database filesystem location. |
|||
.It Ic config-location |
|||
Prints default configuration file filesystem location. |
|||
.It Ic dump-database |
|||
Dumps database data to STDOUT. |
|||
.It Ic list-lists |
|||
Lists all registered mailing lists. |
|||
.It Ic list |
|||
Mailing list management. |
|||
.It Ic create-list |
|||
Create new list. |
|||
.It Ic post |
|||
Post message from STDIN to list. |
|||
.It Ic error-queue |
|||
Mail that has not been handled properly end up in the error queue. |
|||
.El |
|||
.Pp |
@ -0,0 +1,28 @@ |
|||
|
|||
.Bl -tag -width Ds -compact -offset indent |
|||
.It Ic list |
|||
List. |
|||
.It Ic print |
|||
.Fl -index Ar index ... |
|||
index of entry. |
|||
|
|||
.Fl -json |
|||
JSON format. |
|||
|
|||
Print entry in RFC5322 or JSON format. |
|||
.It Ic delete |
|||
.Fl -index Ar index ... |
|||
index of entry. |
|||
|
|||
.Fl -quiet |
|||
Do not print in stdout. |
|||
|
|||
Delete entry and print it in stdout. |
|||
.It Ic list |
|||
List. |
|||
.It Ic print |
|||
Print entry in RFC5322 or JSON format. |
|||
.It Ic delete |
|||
Delete entry and print it in stdout. |
|||
.El |
|||
.Pp |
@ -0,0 +1,2 @@ |
|||
.Sh AUTHORS |
|||
Manos Pitsidianakis <epilys@nessuent.xyz> |
@ -0,0 +1,6 @@ |
|||
.Dd $Mdocdate$ |
|||
.Dt MAILPOT 1 |
|||
.Os |
|||
.Sh NAME |
|||
.Nm mailpot |
|||
.Nd mini mailing list manager. |
@ -0,0 +1,104 @@ |
|||
|
|||
.Bl -tag -width Ds -compact -offset indent |
|||
.It Ic members |
|||
List members of list. |
|||
.It Ic add-member |
|||
.Fl -address Ar address |
|||
E-mail address. |
|||
|
|||
.Fl -name Ar name |
|||
Name. |
|||
|
|||
.Fl -digest |
|||
Send messages as digest?. |
|||
|
|||
.Fl -hide-address |
|||
Hide message from list when posting?. |
|||
|
|||
.Fl -receive-confirmation Ar receive-confirmation |
|||
Hide message from list when posting? Receive confirmation email when posting?. |
|||
|
|||
.Fl -receive-duplicates Ar receive-duplicates |
|||
Receive posts from list even if address exists in To or Cc header?. |
|||
|
|||
.Fl -receive-own-posts Ar receive-own-posts |
|||
Receive own posts from list?. |
|||
|
|||
.Fl -enabled Ar enabled |
|||
Is subscription enabled?. |
|||
|
|||
Add member to list. |
|||
.It Ic remove-member |
|||
.Fl -address Ar address |
|||
E-mail address. |
|||
|
|||
Remove member from list. |
|||
.It Ic update-membership |
|||
Update membership info. |
|||
.It Ic add-policy |
|||
.Fl -announce-only |
|||
. |
|||
|
|||
.Fl -subscriber-only |
|||
. |
|||
|
|||
.Fl -approval-needed |
|||
. |
|||
|
|||
Add policy to list. |
|||
.It Ic remove-policy |
|||
.Fl -pk Ar pk |
|||
. |
|||
|
|||
. |
|||
.It Ic add-list-owner |
|||
.Fl -address Ar address |
|||
. |
|||
|
|||
.Fl -name Ar name |
|||
. |
|||
|
|||
Add list owner to list. |
|||
.It Ic remove-list-owner |
|||
.Fl -pk Ar pk |
|||
. |
|||
|
|||
. |
|||
.It Ic enable-membership |
|||
Alias for update-membership --enabled true. |
|||
.It Ic disable-membership |
|||
Alias for update-membership --enabled false. |
|||
.It Ic update |
|||
Update mailing list details. |
|||
.It Ic health |
|||
Show mailing list health status. |
|||
.It Ic info |
|||
Show mailing list info. |
|||
.It Ic members |
|||
List members of list. |
|||
.It Ic add-member |
|||
Add member to list. |
|||
.It Ic remove-member |
|||
Remove member from list. |
|||
.It Ic update-membership |
|||
Update membership info. |
|||
.It Ic add-policy |
|||
Add policy to list. |
|||
.It Ic remove-policy |
|||
. |
|||
.It Ic add-list-owner |
|||
Add list owner to list. |
|||
.It Ic remove-list-owner |
|||
. |
|||
.It Ic enable-membership |
|||
Alias for update-membership --enabled true. |
|||
.It Ic disable-membership |
|||
Alias for update-membership --enabled false. |
|||
.It Ic update |
|||
Update mailing list details. |
|||
.It Ic health |
|||
Show mailing list health status. |
|||
.It Ic info |
|||
Show mailing list info. |
|||
.El |
|||
.Pp |
@ -0,0 +1,224 @@ |
|||
.Dd $Mdocdate$ |
|||
.Dt MAILPOT 1 |
|||
.Os |
|||
.Sh NAME |
|||
.Nm mailpot |
|||
.Nd mini mailing list manager. |
|||
.Sh SYNOPSIS |
|||
.Nm |
|||
.Op Fl -debug |
|||
.Op Fl -config Ar config |
|||
.Op Fl -quiet | -q |
|||
.Op Fl -verbose | -v |
|||
.Op Fl -timestamp | -t Ar timestamp |
|||
.Bl -tag -width flag -offset indent |
|||
.It Fl -debug |
|||
Activate debug mode. |
|||
.It Fl -config Ar config |
|||
Set config file. |
|||
.It Fl -quiet | -q |
|||
Silence all output. |
|||
.It Fl -verbose | -v |
|||
Verbose mode (-v, -vv, -vvv, etc). |
|||
.It Fl -timestamp | -t Ar timestamp |
|||
Timestamp (sec, ms, ns, none). |
|||
.El |
|||
|
|||
.Sh DESCRIPTION |
|||
This command-line tool allows you to control databases of the mailing list manager |
|||
.Nm Ns . |
|||
.Pp |
|||
.Sh COMMANDS |
|||
|
|||
.Bl -tag -width Ds -compact -offset indent |
|||
.It Ic db-location |
|||
Prints database filesystem location. |
|||
.It Ic config-location |
|||
Prints default configuration file filesystem location. |
|||
.It Ic dump-database |
|||
Dumps database data to STDOUT. |
|||
.It Ic list-lists |
|||
Lists all registered mailing lists. |
|||
.It Ic list |
|||
Mailing list management. |
|||
.It Ic create-list |
|||
.Fl -name Ar name |
|||
List name. |
|||
|
|||
.Fl -id Ar id |
|||
List ID. |
|||
|
|||
.Fl -address Ar address |
|||
List e-mail address. |
|||
|
|||
.Fl -description Ar description |
|||
List description. |
|||
|
|||
.Fl -archive-url Ar archive-url |
|||
List archive URL. |
|||
|
|||
Create new list. |
|||
.It Ic post |
|||
.Fl -dry-run |
|||
. |
|||
|
|||
Post message from STDIN to list. |
|||
.It Ic error-queue |
|||
Mail that has not been handled properly end up in the error queue. |
|||
.It Ic db-location |
|||
Prints database filesystem location. |
|||
.It Ic config-location |
|||
Prints default configuration file filesystem location. |
|||
.It Ic dump-database |
|||
Dumps database data to STDOUT. |
|||
.It Ic list-lists |
|||
Lists all registered mailing lists. |
|||
.It Ic list |
|||
Mailing list management. |
|||
.It Ic create-list |
|||
Create new list. |
|||
.It Ic post |
|||
Post message from STDIN to list. |
|||
.It Ic error-queue |
|||
Mail that has not been handled properly end up in the error queue. |
|||
.El |
|||
.Pp |
|||
|
|||
.Ss list subcommands |
|||
|
|||
.Bl -tag -width Ds -compact -offset indent |
|||
.It Ic members |
|||
List members of list. |
|||
.It Ic add-member |
|||
.Fl -address Ar address |
|||
E-mail address. |
|||
|
|||
.Fl -name Ar name |
|||
Name. |
|||
|
|||
.Fl -digest |
|||
Send messages as digest?. |
|||
|
|||
.Fl -hide-address |
|||
Hide message from list when posting?. |
|||
|
|||
.Fl -receive-confirmation Ar receive-confirmation |
|||
Hide message from list when posting? Receive confirmation email when posting?. |
|||
|
|||
.Fl -receive-duplicates Ar receive-duplicates |
|||
Receive posts from list even if address exists in To or Cc header?. |
|||
|
|||
.Fl -receive-own-posts Ar receive-own-posts |
|||
Receive own posts from list?. |
|||
|
|||
.Fl -enabled Ar enabled |
|||
Is subscription enabled?. |
|||
|
|||
Add member to list. |
|||
.It Ic remove-member |
|||
.Fl -address Ar address |
|||
E-mail address. |
|||
|
|||
Remove member from list. |
|||
.It Ic update-membership |
|||
Update membership info. |
|||
.It Ic add-policy |
|||
.Fl -announce-only |
|||
. |
|||
|
|||
.Fl -subscriber-only |
|||
. |
|||
|
|||
.Fl -approval-needed |
|||
. |
|||
|
|||
Add policy to list. |
|||
.It Ic remove-policy |
|||
.Fl -pk Ar pk |
|||
. |
|||
|
|||
. |
|||
.It Ic add-list-owner |
|||
.Fl -address Ar address |
|||
. |
|||
|
|||
.Fl -name Ar name |
|||
. |
|||
|
|||
Add list owner to list. |
|||
.It Ic remove-list-owner |
|||
.Fl -pk Ar pk |
|||
. |
|||
|
|||
. |
|||
.It Ic enable-membership |
|||
Alias for update-membership --enabled true. |
|||
.It Ic disable-membership |
|||
Alias for update-membership --enabled false. |
|||
.It Ic update |
|||
Update mailing list details. |
|||
.It Ic health |
|||
Show mailing list health status. |
|||
.It Ic info |
|||
Show mailing list info. |
|||
.It Ic members |
|||
List members of list. |
|||
.It Ic add-member |
|||
Add member to list. |
|||
.It Ic remove-member |
|||
Remove member from list. |
|||
.It Ic update-membership |
|||
Update membership info. |
|||
.It Ic add-policy |
|||
Add policy to list. |
|||
.It Ic remove-policy |
|||
. |
|||
.It Ic add-list-owner |
|||
Add list owner to list. |
|||
.It Ic remove-list-owner |
|||
. |
|||
.It Ic enable-membership |
|||
Alias for update-membership --enabled true. |
|||
.It Ic disable-membership |
|||
Alias for update-membership --enabled false. |
|||
.It Ic update |
|||
Update mailing list details. |
|||
.It Ic health |
|||
Show mailing list health status. |
|||
.It Ic info |
|||
Show mailing list info. |
|||
.El |
|||
.Pp |
|||
|
|||
.Ss error-queue subcommands |
|||
|
|||
.Bl -tag -width Ds -compact -offset indent |
|||
.It Ic list |
|||
List. |
|||
.It Ic print |
|||
.Fl -index Ar index ... |
|||
index of entry. |
|||
|
|||
.Fl -json |
|||
JSON format. |
|||
|
|||
Print entry in RFC5322 or JSON format. |
|||
.It Ic delete |
|||
.Fl -index Ar index ... |
|||
index of entry. |
|||
|
|||
.Fl -quiet |
|||
Do not print in stdout. |
|||
|
|||
Delete entry and print it in stdout. |
|||
.It Ic list |
|||
List. |
|||
.It Ic print |
|||
Print entry in RFC5322 or JSON format. |
|||
.It Ic delete |
|||
Delete entry and print it in stdout. |
|||
.El |
|||
.Pp |
|||
|
|||
.Sh AUTHORS |
|||
Manos Pitsidianakis <epilys@nessuent.xyz> |
@ -0,0 +1,14 @@ |
|||
include(`docs/header.mdoc') |
|||
.Sh SYNOPSIS |
|||
include(`docs/main.mdoc') |
|||
.Sh DESCRIPTION |
|||
This command-line tool allows you to control databases of the mailing list manager |
|||
.Nm Ns . |
|||
.Pp |
|||
.Sh COMMANDS |
|||
include(`docs/command.mdoc') |
|||
.Ss list subcommands |
|||
include(`docs/list.mdoc') |
|||
.Ss error-queue subcommands |
|||
include(`docs/error_queue.mdoc') |
|||
include(`docs/footer.mdoc') |
@ -0,0 +1,18 @@ |
|||
.Nm |
|||
.Op Fl -debug |
|||
.Op Fl -config Ar config |
|||
.Op Fl -quiet | -q |
|||
.Op Fl -verbose | -v |
|||
.Op Fl -timestamp | -t Ar timestamp |
|||
.Bl -tag -width flag -offset indent |
|||
.It Fl -debug |
|||
Activate debug mode. |
|||
.It Fl -config Ar config |
|||
Set config file. |
|||
.It Fl -quiet | -q |
|||
Silence all output. |
|||
.It Fl -verbose | -v |
|||
Verbose mode (-v, -vv, -vvv, etc). |
|||
.It Fl -timestamp | -t Ar timestamp |
|||
Timestamp (sec, ms, ns, none). |
|||
.El |
Write
Preview
Loading…
Cancel
Save
Reference in new issue