Need feedback about my code

Hi there,

I’m new to Elixir, and I need some advices about my code. In a few words, it simply lists all directories and subdirectories from a given path.

How to use it? mix escript.build && escript directorytree yourpath

I think the way I parse options from the command line could be better, more concise. Do I really need to do all those things in parse_args? Is reduce the only way I have to list directories? How can I avoid escript and execute directly the directorytree executable under windows?

That’s the kind of questions I’m asking to myself and to you, elixir experts! :wink:

You can find my sources here : https://github.com/DidJS/Directorytree (lib/directorytree.ex)

Thanks in advance for your time,
Didier

Windows does choose its action over a file according to its file-ending. So choose an appropriate ending for your escript and register a handler for it as explained in this SO: Double click to run files with own extension on Windows with own program? - Stack Overflow

A much easier way, that does not mean to mess up with your clients registry (some consider this a security issue) is to simply provide a BAT-Wrapper.