@@ -31,6 +31,12 @@ main = do
31 files <- getRecursiveContents (const $ return False) srcDir
31 files <- getRecursiveContents (const $ return False) srcDir
33 case args of
33 case args of
34+ -- When the argument begins with hyphens, it's more likely that the user
35+ -- intends to attempt some arguments like ("--help", "-h", "--version", etc.)
36+ -- rather than create directory with that name.
37+ -- If dstDir begins with hyphens, the guard will prevent it from creating
38+ -- directory with that name so we can fall to the second alternative
39+ -- which prints a usage info for user.
34 [dstDir] | not ("-" `isPrefixOf` dstDir) -> do
40 [dstDir] | not ("-" `isPrefixOf` dstDir) -> do
35 forM_ files $ \file -> do
41 forM_ files $ \file -> do
36 let dst = dstDir </> file
42 let dst = dstDir </> file