parseCommand :: Parser Command
parseCommand = subparser $ mconcat
    [ command "show" $
        info (helper <*> parseShowCommand) $
            progDesc "Print an interface summary for a package or module"
    , command "compare" $
        info (helper <*> (CompareCommand <$> parseCompare)) $
            progDesc "Compare two packages or modules"
    ]
  where
    parseShowCommand = ShowCommand <$> parseTarget
    parseCompare = asum
        [ CompareThese <$> parseTarget <*> parseTarget
        , CompareInstalled <$> parseTarget
        , pure $ CompareThisInstalled
        ]
parseCommand :: Parser Command
parseCommand = subparser $ mconcat
    [ command "show" $
        info (helper <*> parseShowCommand) $
            progDesc "Print an interface summary for a package or module"
    , command "compare" $
        info (helper <*> (CompareCommand <$> parseCompare)) $
            progDesc "Compare two packages or modules"
    ]
  where
    parseShowCommand = ShowCommand <$> parseTarget
    parseCompare = asum
        [ CompareThese <$> parseTarget <*> parseTarget
        , CompareInstalled <$> parseTarget
        , pure $ CompareThisInstalled
        ]
parseCommand = subparser $ mconcat
    [ command "show" $
        info (helper <*> parseShowCommand) $
            progDesc "Print an interface summary for a package or module"
    , command "compare" $
        info (helper <*> (CompareCommand <$> parseCompare)) $
            progDesc "Compare two packages or modules"
    ]
  where
    parseShowCommand = ShowCommand <$> parseTarget
    parseCompare = asum
        [ CompareThese <$> parseTarget <*> parseTarget
        , CompareInstalled <$> parseTarget
        , pure $ CompareThisInstalled
        ]