I love mix phx.*
they are fantastic. However, I keep forgetting what argument comes first. So, I decided to write a small app that wraps mix phx.*
with relevant prompt messages & hints. It works for me hope it helps others. I call it phx
GitHub - csokun/phx: Phoenix Framework friendly CLI
Subjectively I don’t see custom wrappers have any use for me, because:
- We already have
mix help …
command if something is not clear. - It’s not good way for copy-paste examples (learning resources, creating similar project etc.)
- They are harder to enhance comparing to simple
bash
autocompletion scripts
If I really would need to add something then it would be a simple bash
script for autocompletion.
Also since lots of Unix
commands supports passing arguments like you do, I would rather ask a phoenix core team if such idea could be merged to phoenix
project instead of creating a wrapper.
If we would take a look at phx.new
task code then we would see how simple would be a way to add prompts:
In this case simple defp parse_opts([]) do … end
function clause would do the work.
This is cool, thank you. I’m the kind of developer who runs ssh-keygen
to follow the interactive dialog. It’s annoying to need to learn a special, unrelated DSL (how to use a CLI app) just to get some other task done. I think it’s a legacy anti-pattern, TBH. I already need to truly know 10–20 languages that actually produce value. I’ll avoid spending time learning yet another that doesn’t actually generate business value.
That being said, Golang blows every chimp in the zoo, IMO. I’m not going to be contributing any time soon. In some perfect world, your code would work in Elixir and be DRY vis a vis the existing argument parser.