You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moving all the helper functions (functions that do not have a corresponding command) into App
Removing the functions that have commands corresponding to them from App and just having them as regular functions in main.rs (or as part of a Cli type)
Making the App constructor to take a single package_name parameter: let app = App::new("dev.CoCtus.coctus");
This would then separate the responsibility between calling the commands and the helper functions which we could use in tests. It would also prepare for #61 by allowing configuration to be stored in App and be used by users of the lib.
I've given this some thought and I think that it would be better to expose a simpler API that is completely agnostic of the coctus CLI tool and its data/config (that means keeping App private as its only purpose is to hold references to the configuration directories). Users of the library should have the choice of using their own config/data if they want to be independent of coctus the command line tool.
There are probably some methods in App that do "too much" though. Ideally they would follow this recipe (limiting I/O to the edges of the app):
Doing I/O (reading args, environment variables and files)
Passing the data forward to pure, easy-to-test functions (which we may want to expose in lib)
re: @ellnix (from #71)
I've given this some thought and I think that it would be better to expose a simpler API that is completely agnostic of the
coctus
CLI tool and its data/config (that means keepingApp
private as its only purpose is to hold references to the configuration directories). Users of the library should have the choice of using their own config/data if they want to be independent ofcoctus
the command line tool.There are probably some methods in
App
that do "too much" though. Ideally they would follow this recipe (limiting I/O to the edges of the app):Originally posted by @Andriamanitra in #70 (comment)
The text was updated successfully, but these errors were encountered: