module Data
( Oneline(..)
, Cmd(..)
, Option(..)
, Argument(..)
, cmdFormat 
, optFormat 
, argFormat 
, mytail
) where

data Oneline = Line Cmd [Option] [Argument] deriving (Eq,Show)

data Cmd = Cmd String deriving (Eq,Show)

data Option = Option String [Argument] deriving (Eq,Show)

data Argument = Argument String deriving (Eq,Show)

cmdFormat (Cmd str) = str
optFormat (Option str arg) = str ++ "[" ++ (reverse $mytail $ reverse $ (concatMap argFormat arg)) ++ "]," 
argFormat (Argument str) = str ++ ","

mytail [ ] = [ ]
mytail xs = tail xs
 