]> gitweb.michael.orlitzky.com - mailbox-count.git/blobdiff - src/CommandLine.hs
Add SQLite support (default if a filename is given as the database).
[mailbox-count.git] / src / CommandLine.hs
index 578179e9add1c60af9d7421d62bbefd821ccdf78..6fb30fedc151d735346338be62551232ca3e8d42 100644 (file)
@@ -30,39 +30,50 @@ my_summary = program_name ++ "-" ++ (showVersion version)
 
 database_help :: String
 database_help =
-  "The name of the database to which we should connect"
+  "The name of the database (or file, if SQLite) to which we should connect"
 
 detail_help :: String
 detail_help =
   "Produce a detailed report listing all mailboxes by domain"
 
+detail_query_help :: String
+detail_query_help =
+  "SQL query used to produce the detail report"
+
 host_help :: String
 host_help =
-  "Hostname where the database is located"
+  "Hostname where the database is located (postgres-only)"
 
 password_help :: String
 password_help =
-  "Password used to connect to the database"
+  "Password used to connect to the database (postgres-only)"
 
 port_help :: String
 port_help =
-  "Port number used to connect to the database"
+  "Port number used to connect to the database (postgres-only)"
+
+summary_query_help :: String
+summary_query_help =
+  "SQL query used to produce the summary report"
 
 username_help :: String
 username_help =
-  "Username used to connect to the database"
+  "Username used to connect to the database (postgres-only)"
 
 arg_spec :: OptionalConfiguration
-arg_spec = OptionalConfiguration
-     { database = def &= help database_help,
-       detail   = def &= help detail_help,
-       host     = def &= help host_help,
-       password = def &= help password_help,
-       port     = def &= help port_help,
-       username = def &= help username_help }
-      &= program program_name
-      &= summary my_summary
-      &= details [description]
+arg_spec =
+  OptionalConfiguration {
+    database = def &= help database_help,
+    detail   = def &= help detail_help,
+    detail_query   = def &= help detail_query_help,
+    host     = def &= help host_help,
+    password = def &= help password_help,
+    port     = def &= help port_help,
+    summary_query   = def &= help summary_query_help,
+    username = def &= help username_help }
+    &= program program_name
+    &= summary my_summary
+    &= details [description]
 
 get_args :: IO OptionalConfiguration
 get_args = cmdArgs arg_spec