Create robust CLI apps with Bashly - a tutorial #666
Replies: 3 comments 5 replies
-
Wow - this looks like it was a lot of work.... |
Beta Was this translation helpful? Give feedback.
-
I have followed it, and it is very nice. It is interesting to see this from the perspective of someone else :) I wondered why are you using if [[ "${args[--web]}" == 1 ]]; then rather than just if [[ "${args[--web]}" ]]; then |
Beta Was this translation helpful? Give feedback.
-
@DannyBen (and anyone else) I also would appreciate your input about this... One thing in the tutorial that is more my personal coding style than a "widely adopted" way of coding: Passing arguments to functions rather than allowing them access I mean, doing this generate_random_number() {
local max_number="$1"
# ...
}
# now I'm forced to call it with an arg
generate_random_number "$max_number" rather than just generate_random_number() {
local max_number="${args[--max]}"
# ...
}
# I don't need to pass any argument
# (it was handled by Bashly)
generate_random_number The justifications for my style are:
But, to be honest, I'm not really sold on these ideas, and sometimes I feel like it's over-engineering. What are your opinions about this? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Here's my attempt to introduce more people to the power of Bashly:
https://dev.to/meleu/create-robust-cli-apps-with-bashly-5gb0
Any feedback is very welcome.
@DannyBen I said I would put it on the wiki but was unsure about where to put it. 😅
Beta Was this translation helpful? Give feedback.
All reactions