Improved command-line options structure.

This commit is contained in:
Dominik Pantůček 2023-05-14 22:32:54 +02:00
parent 6135a09664
commit 537bac7100

View file

@ -67,7 +67,6 @@
(print banner-line) (print banner-line)
(newline) (newline)
(print "Command-line options:") (print "Command-line options:")
(newline)
(print-help) (print-help)
(newline) (newline)
(exit 0)) (exit 0))
@ -93,21 +92,21 @@
(*bank-dir* dir)) (*bank-dir* dir))
(-checked (file) "JendaSAP checked.ntlm file" (-checked (file) "JendaSAP checked.ntlm file"
(*jendasap-checked* file)) (*jendasap-checked* file))
(-ml-all () "Load all mailman lists" ""
(-ml-all- #t)) "Email options:"
(-destroyed () "Show destroyed members in -fees" (-from (email) "Sender email address"
(-show-destroyed- #t)) (*email-from* email))
(-sendmail () "Actually send emails" (-sendmail () "Actually send emails"
(-send-emails- #t)) (-send-emails- #t))
(-mailto (email) "Override all outgoing emails destination" (-mailto (email) "Override all outgoing emails destination"
(*mailto-override* email)) (*mailto-override* email))
""
"Output options:"
(-logfile (filename) "Enable logging to file" (-logfile (filename) "Enable logging to file"
(*log-file* filename)) (*log-file* filename))
(-quiet () "Suppress all output" (-quiet () "Suppress all output"
(*stdout-quiet* #t) (*stdout-quiet* #t)
(*progress-quiet* #t)) (*progress-quiet* #t))
(-from (email) "Sender email address"
(*email-from* email))
"" ""
"Query options:" "Query options:"
(-mi (id) "Specify member by id" (-member-id- (string->number id))) (-mi (id) "Specify member by id" (-member-id- (string->number id)))
@ -116,41 +115,56 @@
(-action- 'no-op)) (-action- 'no-op))
(-member-nick- nick)) (-member-nick- nick))
"" ""
"Actions:" "Misc options:"
(-destroyed () "Show destroyed members in -fees"
(-show-destroyed- #t))
(-ml-all () "Load all mailman lists"
(-ml-all- #t))
""
"Base Actions:"
(-info () "Print information" (-info () "Print information"
(-needs-bank- #t) (-needs-bank- #t)
(-action- 'print-info)) (-action- 'print-info))
(-stats (file:gnuplot-data) "Get stats for all months"
(-action- 'print-stats)
(-fname- file:gnuplot-data))
(-print () "Print given member file" (-print () "Print given member file"
(-action- 'print-member-file)) (-action- 'print-member-file))
(-tests () "Run self-tests upon startup" (-run-tests?- #t))
(-idstats () "Returns information about available member ids" (-action- 'print-idstats))
(-genid () "Generates random member id" (-action- 'genid))
(-gencards (file:cards file:desfires) "Generates brmdoor-compatible card files"
(-action- 'gencards)
(-fname- (list file:cards file:desfires)))
(-problems () "Prints all files with problems" (-action- 'problems))
(-fees () "Prints fees table" (-fees () "Prints fees table"
(-needs-bank- #t) (-needs-bank- #t)
(-action- 'fees)) (-action- 'fees))
(-problems () "Prints all files with problems"
(-action- 'problems))
(-status () "Show members directory status"
(-action- 'status))
(-unpaired () "Show latest unpaired bank transactions"
(-needs-bank- #t)
(-action- 'unpaired))
(-edit () "Edit selected user"
(-action- 'edit))
""
"Id Management Actions:"
(-idstats () "Returns information about available member ids"
(-action- 'print-idstats))
(-genid () "Generates random member id"
(-action- 'genid))
""
"Export Actions:"
(-gencards (file:cards file:desfires) "Generates brmdoor-compatible card files"
(-action- 'gencards)
(-fname- (list file:cards file:desfires)))
(-genweb (dir) "Generate static web files" (-genweb (dir) "Generate static web files"
(-needs-bank- #t) (-needs-bank- #t)
(-web-dir- dir) (-web-dir- dir)
(-action- 'genweb)) (-action- 'genweb))
(-repl () "Start REPL with everything loaded" (-stats (file:gnuplot-data) "Get stats for all months"
(-needs-bank- #t) (-action- 'print-stats)
(-action- 'repl)) (-fname- file:gnuplot-data))
(-edit () "Edit selected user" ""
(-action- 'edit)) "Mailman Actions:"
(-unpaired () "Show latest unpaired bank transactions"
(-needs-bank- #t)
(-action- 'unpaired))
(-mlcheck () "Check internal ML" (-mlcheck () "Check internal ML"
(-action- 'mlcheck)) (-action- 'mlcheck))
(-mlsync () "Synchronize internal ML" (-mlsync () "Synchronize internal ML"
(-action- 'mlsync)) (-action- 'mlsync))
""
"Email Actions:"
(-notify () "Members with debt for more than 1 month" (-notify () "Members with debt for more than 1 month"
(-notify-months- 1) (-notify-months- 1)
(-needs-bank- #t) (-needs-bank- #t)
@ -159,11 +173,16 @@
(-notify-months- 3) (-notify-months- 3)
(-needs-bank- #t) (-needs-bank- #t)
(-action- 'notify)) (-action- 'notify))
(-status () "Show members directory status"
(-action- 'status))
(-summary () "Send summary email" (-summary () "Send summary email"
(-needs-bank- #t) (-needs-bank- #t)
(-action- 'summary)) (-action- 'summary))
""
"Development Actions:"
(-tests () "Run self-tests upon startup"
(-run-tests?- #t))
(-repl () "Start REPL with everything loaded"
(-needs-bank- #t)
(-action- 'repl))
) )
;; Print banner ;; Print banner