Subversion Repositories svn.Prod repos

Rev

Rev 40 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#! /usr/bin/env escript
# https://rosettacode.org/wiki/Walk_a_directory/Recursively
# TODO : de hele traversal nog schrijven, dit is alleen argument parsing

defmodule DezeModule do

        def usage(progname, mesg) do
                IO.puts "Usage: " <> progname <> " filefind" 
                IO.puts mesg    
        end

end

progname = System.cwd()

if length(System.argv) == 1 do
        directory = Enum.at(System.argv(), 0)
        if File.dir?(directory)
        do
                IO.puts "TODO: Now do the traversal"
        else
                DezeModule.usage(progname, "ERROR: Not a directory : " <> directory)
        end
else
        DezeModule.usage(progname, "ERROR: 1 argument expected")
end