소스 검색

Add manpage and update usage message.

The man page is in mdoc format.  It can be view by typing "man -l tmpmail.1" from its directory.  The usage message is an excerpt of the man page slightly reformated: "man -l -Tascii tmpmail.1"
Greg Reagle 5 년 전
부모
커밋
2e7ade4808
2개의 변경된 파일68개의 추가작업 그리고 9개의 파일을 삭제
  1. 24 9
      tmpmail
  2. 44 0
      tmpmail.1

+ 24 - 9
tmpmail

@@ -38,15 +38,30 @@ usage() {
     # Using 'cat << EOF' we can easily output a multiline text. This is much
     # better than using 'echo' for each line or using '\n' to create a new line.
     cat <<EOF
-usage: tmpmail [-h] [--generate] [--browser BROWSER] [--recent] ID
-
-optional arguments:
--h, --help           Show this help message
-    --version        Print version
--g, --generate       Generate a new email address. You may also pass a custom username along with this flag
--r, --recent         View the most recent email
--t, --text           View the email as raw text, where all the HTML tags are removed
--b, --browser        Change the browser that is used to render the HTML of the email (default: w3m)
+tmpmail
+tmpmail -h | --version
+tmpmail -g [ADDRESS]
+tmpmail [-t | -b BROWSER] -r | ID
+
+When called with no option and no argument, tmpmail lists the messages in
+the inbox and their numeric IDs.  When called with one argument, tmpmail
+shows the email message with specified ID.
+
+-b, --browser BROWSER
+        Specify BROWSER (default: w3m) that is used to render the HTML of
+        the email
+-g, --generate [ADDRESS]
+        Generate a new email address, either the specified ADDRESS, or
+        randomly create one
+-h, --help
+        Show help
+-r, --recent
+        View the most recent email message
+-t, --text
+        View the email as raw text, where all the HTML tags are removed.
+        Without this option, HTML is used.
+--version
+        Show version
 EOF
 }
 

+ 44 - 0
tmpmail.1

@@ -0,0 +1,44 @@
+.Dd 2020-10-01
+.Dt tmpmail 1
+.Os
+.Sh NAME
+.Nm tmpmail
+.Nd temporary mail
+.Sh SYNOPSIS
+.Nm
+.Nm
+.Fl h | -version
+.Nm
+.Fl g Op Ar ADDRESS
+.Nm
+.Op Fl t | b Ar BROWSER
+.Fl r | Ar ID
+.Sh DESCRIPTION
+.Nm
+is a command line utility written in POSIX shell that allows you to create a temporary email address and receive emails to the temporary email address. It uses 1secmail's API to receive emails.
+.Ss Options and Arguments
+When called with no option and no argument,
+.Nm
+lists the messages in the inbox and their numeric IDs.
+When called with one argument,
+.Nm
+shows the email message with specified
+.Ar ID .
+.Bl -tag -width Ds
+.It Fl b , Fl Fl browser Ar BROWSER
+Specify
+.Ar BROWSER
+(default: w3m) that is used to render the HTML of the email
+.It Fl g , Fl Fl generate Op Ar ADDRESS
+Generate a new email address, either the specified
+.Ar ADDRESS ,
+or randomly create one
+.It Fl h , Fl Fl help
+Show help
+.It Fl r , Fl Fl recent
+View the most recent email message
+.It Fl t , Fl Fl text
+View the email as raw text, where all the HTML tags are removed.  Without this option, HTML is used.
+.It Fl Fl version
+Show version
+.El