3 ms·
Sooo.. it's a yaml-based bash DSL that manually cross-compiles back to .. bash? It's probably clever, sure, but it seems like this would wind up more declarati
by esoterae 5y ago
Sooo.. it's a yaml-based bash DSL that manually cross-compiles back to .. bash?
It's probably clever, sure, but it seems like this would wind up more declarative than imperative?
- dannyben 5y agoNo. No DSL. 1. Define your commands + flags + args in YAML (`bashly init` creates this YAML). 2. Bashly generates the standalone script and empty "placeholder" scripts for your actual bash code (`bashly generate`). 3. You plug in your bash code. 4. Bashly merges it all back to the same single final script (`bashly generate`). 5. Rinse and repeat.
- verdverm 5y agoThe yaml schema is in essence a DSL. It has required terms that have a specific meaning, in this case specific to CLI UX. What happens when I get to 5 and want to change an arg for cdm/foo? Does step 3 need to be repeated in its entirety?
- dannyben 5y agoNo need to repeat step 3. Code for each command (in case you want a bash script with subcommands), is placed in `src/<command_name>_command.sh`. Running `bashly generate` will always read it and re-merge it. I think this is a good minimal example: https://github.com/DannyBen/bashly/tree/master/examples/minimal#minimal-example https://github.com/DannyBen/bashly/tree/master/examples/mini...