Command -package:hedgehog package:Cabal

This is to do with command line handling. The Cabal command line is organised into a number of named sub-commands (much like darcs). The CommandUI abstraction represents one of these sub-commands, with a name, description, a set of flags. Commands can be associated with actions and run. It handles some common stuff automatically, like the --help and command line completion flags. It is designed to allow other tools make derived commands. This feature is used heavily in cabal-install.
wraps a CommandUI together with a function that turns it into a Command. By hiding the type of flags for the UI allows construction of a list of all UIs at the top level of the program. That list can then be used for generation of manual page as well as for executing the selected command.
Initial / empty flags
Additional explanation of the command to use in help texts.
The name of the command as it would be entered on the command line. For example "build".
Post-Usage notes and examples in help texts
All the Option fields for this command
Parse a bunch of command line arguments
Show flags in the standard long option command line format
A short, one line description of the command to use in help texts.
A function that maps a program name to a usage summary for this command.