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 :-)
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 :-)