getInfoFromNodes :: String -> ([Node] -> [String]) -> CmdlState -> IO CmdlState
getInfoFromNodes input f state =
  case i_state $ intState state of
    Nothing -> return state
    Just dgState -> let (errors, nodes) = getInputNodes input dgState
                     in return (if null nodes
                                  then genMsgAndCode errors 1 state
                                  else genMessage errors
                                         (intercalate "\n" $ f nodes) state)
getInfoFromNodes :: String -> ([Node] -> [String]) -> CmdlState -> IO CmdlState
getInfoFromNodes input f state =
  case i_state $ intState state of
    Nothing -> return state
    Just dgState -> let (errors, nodes) = getInputNodes input dgState
                     in return (if null nodes
                                  then genMsgAndCode errors 1 state
                                  else genMessage errors
                                         (intercalate "\n" $ f nodes) state)
getInfoFromNodes input f state =
  case i_state $ intState state of
    Nothing -> return state
    Just dgState -> let (errors, nodes) = getInputNodes input dgState
                     in return (if null nodes
                                  then genMsgAndCode errors 1 state
                                  else genMessage errors
                                         (intercalate "\n" $ f nodes) state)