bash-script-template icon indicating copy to clipboard operation
bash-script-template copied to clipboard

Add defaults to `parse_params()`

Open bbros-dev opened this issue 5 years ago • 2 comments

Taking on board the feedback in PR #8, I'm feeding back some changes I've found useful.

For consideration:

# DESC: Variable defaults
# ARGS: None.
# OUTS: Variables with default values set.
function defaults() {
  verbose=false no_colour=false cron=false outfile=-
}

...

function parse_params() {
....
  local param
  defaults
  # now enjoy the options in order and nicely split until we see --
....

bbros-dev avatar Mar 29 '20 01:03 bbros-dev

Could be merged to the template? I find that pretty useful, specially for noobies

BorjaEst avatar Feb 24 '21 08:02 BorjaEst

+1

felipepodesta avatar Nov 22 '21 03:11 felipepodesta