removeFile :: Options -> FilePath -> IO ()
removeFile opts fp = do
    when (optReportRemove opts) $ do
        st <- getSymbolicLinkStatus fp
        if isSymbolicLink st
            then readSymbolicLink fp >>= putStrLn . ((fp ++ "@ -> ") ++)
            else putStrLn fp
    case (optRemove opts) of
        OptDryRun -> return ()
        OptScript -> putStrLn ("rm -f " ++ fp)
        OptRemove -> safely fp $ removeLink fp

-- | Symlink a file. Like shell command "ln -sf".
-- If file is a symlinks, removes the symlink, not what it points to.
removeFile :: Options -> FilePath -> IO ()
removeFile opts fp = do
    when (optReportRemove opts) $ do
        st <- getSymbolicLinkStatus fp
        if isSymbolicLink st
            then readSymbolicLink fp >>= putStrLn . ((fp ++ "@ -> ") ++)
            else putStrLn fp
    case (optRemove opts) of
        OptDryRun -> return ()
        OptScript -> putStrLn ("rm -f " ++ fp)
        OptRemove -> safely fp $ removeLink fp

-- | Symlink a file. Like shell command "ln -sf".
-- If file is a symlinks, removes the symlink, not what it points to.
removeFile opts fp = do
    when (optReportRemove opts) $ do
        st <- getSymbolicLinkStatus fp
        if isSymbolicLink st
            then readSymbolicLink fp >>= putStrLn . ((fp ++ "@ -> ") ++)
            else putStrLn fp
    case (optRemove opts) of
        OptDryRun -> return ()
        OptScript -> putStrLn ("rm -f " ++ fp)
        OptRemove -> safely fp $ removeLink fp

-- | Symlink a file. Like shell command "ln -sf".
-- If file is a symlinks, removes the symlink, not what it points to.