lfe-deprecated / lfetool

DEPRECATED - See:
https://github.com/lfe-rebar3/
Other
61 stars 19 forks source link

Create command record and pass that around #87

Open oubiwann opened 10 years ago

oubiwann commented 10 years ago

This is more of a question, than anything. Should we do this?

It's a common Erlang idiom to define a state data structure for a given problem, and pass that data structure around, pattern matching on fields, etc. In lfetool, we could create a data structure after parsing the command input, setting things like command, subcommand (or plugin), plugin? (bool), cwd (instead of calling (lfetool-util:get-cwd) whenever we need it), and probably some more.

This might simplify some logic, remove unnecessary calls, and create world peace. Also, it will be comforting to Erlangers checking out LFE code :-)