]> gitweb.michael.orlitzky.com - dead/htsn.git/blobdiff - src/CommandLine.hs
Tiny change to the description used in CmdArgs.
[dead/htsn.git] / src / CommandLine.hs
index d710b18c0c5d040468ef98aa0781e3f34547670e..0a5a5a563a950f19f6a4ef2747b7de9eb26ca54f 100644 (file)
@@ -1,3 +1,5 @@
+-- | Parse the command-line options, and display help text if
+--   necessary.
 module CommandLine (
   get_args )
 where
@@ -13,47 +15,57 @@ import System.Console.CmdArgs (
   typ,
   typDir )
 
--- Get the version from Cabal.
+-- This let's us get the version from Cabal.
 import Paths_htsn (version)
 import Data.Version (showVersion)
 
 import OptionalConfiguration (OptionalConfiguration(..))
 
+
+-- | The description of the program, displayed as part of the help.
 description :: String
-description = "Parse XML files from The Sports Network."
+description = "Parse XML files from The Sports Network feed."
 
+-- | The name of this program.
 program_name :: String
 program_name = "htsn"
 
+-- | A summary string output as part of the help.
 my_summary :: String
 my_summary = program_name ++ "-" ++ (showVersion version)
 
+
+-- | A description of the "password" option.
 password_help :: String
 password_help =
   "Password to use when connecting to the feed"
 
+-- | A description of the "output_directory" option.
 output_directory_help :: String
 output_directory_help =
   "Directory in which to output the XML files; must be writable"
 
+-- | A description of the "username" option.
 username_help :: String
 username_help =
   "Username to use when connecting to the feed"
 
+-- | A data structure representing the possible command-line
+--   options. The CmdArgs library is doing heavy magic beneath the
+--   hood here.
 arg_spec :: OptionalConfiguration
 arg_spec =
   OptionalConfiguration {
     password         = def &= typ "PASSWORD" &= help password_help,
     output_directory = def &= typDir         &= help output_directory_help,
     username         = def &= typ "USERNAME" &= help username_help,
-    -- Using "def" below for the FeedHosts causes the list to show up in
-    -- reverse. Don't ask me why.
     feed_hosts       = def &= typ "HOSTNAMES" }
   &= program program_name
   &= summary my_summary
   &= details [description]
 
 
-
+-- | A convenience function; our only export. Meant to be used in
+--   'main' to retrieve the command-line arguments.
 get_args :: IO OptionalConfiguration
 get_args = cmdArgs arg_spec