Fix being able to pipe an INI into the parser.
This commit is contained in:
parent
dbc6dd7a91
commit
ca00b03cb7
1 changed files with 3 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Bash INI file parser v0.1.0.
|
# Bash INI file parser v0.1.1.
|
||||||
# Copyright (C) 2019 Darren 'Tadgy' Austin <darren (at) afterdark.org.uk>.
|
# Copyright (C) 2019 Darren 'Tadgy' Austin <darren (at) afterdark.org.uk>.
|
||||||
# Licensed under the terms of the GNU General Public Licence version 3.
|
# Licensed under the terms of the GNU General Public Licence version 3.
|
||||||
#
|
#
|
||||||
|
|
@ -115,6 +115,7 @@ parser_getopts() {
|
||||||
return 2
|
return 2
|
||||||
;;
|
;;
|
||||||
--)
|
--)
|
||||||
|
shift
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
--*|-*)
|
--*|-*)
|
||||||
|
|
@ -281,7 +282,7 @@ parse_ini() {
|
||||||
|
|
||||||
# If reading from stdin, don't try to open the FD as it's already open.
|
# If reading from stdin, don't try to open the FD as it's already open.
|
||||||
if [[ "$INIFILE" == "-" ]]; then
|
if [[ "$INIFILE" == "-" ]]; then
|
||||||
INIFD="1"
|
INIFD="0"
|
||||||
else
|
else
|
||||||
# File accessability checks.
|
# File accessability checks.
|
||||||
if [[ ! -e "$INIFILE" ]]; then
|
if [[ ! -e "$INIFILE" ]]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue