        <*> (option auto (long "index" <> help "Index of ambiguous parse" <> showDefault <> value 0 <> metavar "INT"))
        <*> (flag' Pretty (long "pretty" <> help "Pretty-print output")
             <|> flag' Tree (long "tree" <> help "Print the output as an abstract syntax tree")
             <|> pure Plain)
        <*> optional (strArgument
            ( metavar "FILE"
              <> help "Dart file to parse"))

    mode :: Parser GrammarMode
    mode = CompilationUnitMode <$ switch (long "compilation-unit")
       <|> DeclarationMode     <$ switch (long "statement")
       <|> ExpressionMode      <$ switch (long "expression")

main' :: Opts -> IO ()
main' opts@Opts{..} =