purescript-cookbook icon indicating copy to clipboard operation
purescript-cookbook copied to clipboard

Add make -help commands

Open milesfrain opened this issue 5 years ago • 5 comments

Show all available commands for a recipe with something like:

make MyRecipeName-help

Planning to pull out the command-printing code from scripts/newRecipe.sh into a scripts/showHelp.sh, and call this new script from both the original newRecipe.sh script and the makefile.

milesfrain avatar Aug 29 '20 00:08 milesfrain

To clarify, I thought the command would just be make help, not make RecipeName-help. What happens if you forget what the recipe was called / the recipe name you chose?

JordanMartinez avatar Aug 29 '20 13:08 JordanMartinez

If you don't specify the recipe name, then we won't be able to provide copy-pastable make commands (which need to have the recipe name in them). So we could provide a command reference with a generic MyRecipeName placeholder, or just show the suffixes, but then we'll likely be showing some invalid commands. The existing scripts/newRecipe.sh customizes the displayed commands based on recipe type, for example whether to show -node or -web, etc.

We could do something tricky to guess what recipe they need help with, such as looking for the newest recipe directory. But I think it's better to just require the recipe name.

What happens if you forget what the recipe was called / the recipe name you chose?

I feel like this is unlikely, since you have at least 3 ways to figure this out:

  • check command history
  • check git status
  • sort recipes by date: ls -lrt recipes

milesfrain avatar Aug 29 '20 15:08 milesfrain

Good points. Thanks for your feedback.

Perhaps this problem could be resolved differently. When we run make or make list, we could update the output to say:

Run `make <RecipeName>-<target>` run a recipe named `RecipeName` via the target, `target`.

Run `make <RecipeName>-help` to see a list of all copy-and-paste commands 
for a given recipe. For example `make HelloWorld-help`.

=== Node Recipes ===
...
That would solve the "general help" message people would see while still making the "specific help" message better.

JordanMartinez avatar Aug 29 '20 20:08 JordanMartinez

Yes, that sounds good. Although the the make/make list output is pretty long now, so I don't think users will see a note at the top. Maybe we put it at the bottom.

milesfrain avatar Aug 29 '20 20:08 milesfrain

Yeah, bottom sounds like a better idea.

JordanMartinez avatar Aug 29 '20 20:08 JordanMartinez