Luis and I would like some feedback on how to proceed with some of our “generator” style commands such as “init” or “coldbox create app”. There are different use cases we’re imagining.
Use Case #1
Some people know what they want, and just want to get there with the least amount of characters typed and time taken. These people might also be automating and don’t want any interactivity.
init name=foo
coldbox create app myApp
Done! This approach is quick and easy for someone just wanting to throw a site together, ignore optional items, or reduce typing.
Use Case #2
Other people want a friendly, interactive approach. Perhaps they aren’t familiar with all the possible options and they’d prefer an experience like so:
init
Enter name (The human-readable name for this package) : myPackage
Enter version (The version for this package, please use semantic versioning - 0.0.0) : 1.0.0
Enter private (Would you like to mark your package as private, which prevents it to submit it to ForgeBox)(Yes/No) : yes
Enter shortDescription (A short description for the package) : This is my cool package
Enter author (The author of the package, you!) : Brad Wood
Enter keywords (A nice list of keywords that describe your package) : Brad, Cool, Package
Enter homepage (Your package’s homepage URL) : http://bradwood.com
Enter ignoreList (add commonly ignored files to the package’s ignore list)(Yes/No) : box.json, tests/, readme.txt
coldbox create app
Enter name (The name of the app you want to create) : myApp
Enter skeleton (The name of the app skeleton to generate) : AvancedScript
Enter directory (The directory to create the app in and creates the directory if it does not exist. Defaults to your current working directory.) :
Enter init (“init” the directory as a package if it isn’t already) (Yes/No) : no
Enter installColdBox (Install the latest stable version of ColdBox from ForgeBox) (Yes/No) : no
Enter installColdBoxBE (Install the bleeding edge version of ColdBox from ForgeBox) (Yes/No) : yes
Enter installTestBox (Install the latest stable version of TestBox from ForgeBox) (Yes/No) : yes
Each of those lines above would be a prompt that would pause execution while waiting for the user to input values. This would help you through the process if you weren’t aware of the options or just enjoyed the question/answer style. This is common with other tools like Yeoman generators.
Your opinion:
This is where you come in.
- Which of those two behaviors should be default with CommandBox?
- Which would you use more often?
- How can we support both easily?
- Two separate commands?
- A --wizard flag?
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com