Skip to content

Add defaults to parse_params #9

Open
@bbros-dev

Description

@bbros-dev

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 --
....

Activity

changed the title [-]Idea: Add `defaults` to parse_params()[/-] [+]Idea: Add `defaults` to `parse_params`[/+] on Mar 29, 2020
self-assigned this
on Nov 8, 2020
changed the title [-]Idea: Add `defaults` to `parse_params`[/-] [+]Idea: Add defaults to parse_params[/+] on Nov 8, 2020
changed the title [-]Idea: Add defaults to parse_params[/-] [+]Add defaults to parse_params[/+] on Jan 16, 2021
BorjaEst

BorjaEst commented on Feb 24, 2021

@BorjaEst

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

felipepodesta

felipepodesta commented on Nov 22, 2021

@felipepodesta

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @felipepodesta@ralish@BorjaEst@bbros-dev

      Issue actions

        Add defaults to parse_params · Issue #9 · ralish/bash-script-template