nmis-parser: NMIS file parser

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Parser for NMIS (Network Management Information System) files to record type. Main module to use is Text.Nmis and parseNmis function


[Skip to ReadMe]

Properties

Versions0.1.0.0, 0.1.0.1, 0.1.0.1
Change logNone available
Dependenciesbase (>=4.7 && <5), containers, megaparsec (<5.3.2) [details]
LicenseBSD-3-Clause
Copyright2017 Sasa Bogicevic
AuthorSasa Bogicevic
Maintainerbrutallesale@gmail.com
CategoryText, Parsers
Home pagehttps://github.com/v0d1ch/nmis-parser#readme
Source repositoryhead: git clone https://github.com/v0d1ch/nmis-parser
UploadedSat Aug 12 21:03:19 UTC 2017 by v0d1ch

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for nmis-parser-0.1.0.1

[back to package description]

NMIS file parser

This parser parses the NMIS format files to Nmis record type

Example usage :

  module Main where
  import System.Environment (getArgs)
  import System.IO
  import Text.Megaparsec
  import Text.Nmis

  main :: IO ()
  main = do
    args <- getArgs
    case args of
      [] -> putStrLn "error: you need to pass in file path"
      [path] -> do
              contents <- readFile path
              let result = parse parseNmis "" contents
              case result of
                  Left nodes -> print $ parseErrorPretty nodes
                  Right nodes -> do
                      print nodes
      _ -> putStrLn "error: you need to pass in only one file path"