From 1e585cbb9208305d683c04d9e3e2eff0834117fd Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 23 Apr 2019 21:06:28 -0400 Subject: parse_control(): Make req_fields arg optional --- (limited to 'src/control.sh') diff --git a/src/control.sh b/src/control.sh index 04a4c2d..6a92ff3 100644 --- a/src/control.sh +++ b/src/control.sh @@ -42,7 +42,9 @@ parse_control() local file="${1}" local field_cb="${2}" local paragraph_cb="${3}" - local req_fields="${4}" + shift 3 + local check_fields= + local req_fields= local line_nr= local in_paragraph= local line= @@ -51,6 +53,13 @@ parse_control() local name= local value= + check_fields='false' + if [ ${#} -eq 1 ]; then + req_fields="${1}" + shift 1 + check_fields='true' + fi + line_nr=0 in_paragraph='false' -- cgit v0.9.1