packages feed

yjftp-0.3: yjftp.hs

module Main where

import Network.Yjftp

myCommandList :: CommandList
myCommandList = [
   ("?",     helpFTP)
 , ("q",     quitFTP)
 , ("quit",  quitFTP)
 , ("exit",  quitFTP)
 , ("bye",   quitFTP)
 , ("!",     systemFTP)
 , ("pwd",   pwdFTP)
 , ("ls",    \h args   -> case args of
                            ("-l":args_) -> directoryFTP h args_
                            _            -> listFTP h args)
 , ("cd",    changeDirectoryFTP)
 , ("lcd",   changeDirectoryLocal)
 , ("put",   putFileFTP)
 , ("get",   getFileFTP)
 , ("cat",   showFileFTP)
 , ("rm",    removeFileFTP)
 , ("mkdir", makeDirectoryFTP)
 , ("rmdir", removeDirectoryFTP)
 , ("mv",    moveFileFTP)
 , ("cp",    copyFileFTP)
 , ("vi",    editBy ("vi "++))
 , ("view",  readBy ("view "++))
 ]

main :: IO ()
main = runYjftp myCommandList