mirror of https://github.com/garabik/grc.git
better reporting of invalid configuration files
This commit is contained in:
parent
7a48f0d91e
commit
0ae0ce08a8
1
grc
1
grc
|
@ -103,7 +103,6 @@ if cfile != "" and colour:
|
|||
if stderrff:
|
||||
choe, chie = os.pipe()
|
||||
|
||||
|
||||
pidp = os.fork()
|
||||
if pidp == 0: # child
|
||||
if stdoutff:
|
||||
|
|
9
grcat
9
grcat
|
@ -119,7 +119,14 @@ while not is_last:
|
|||
continue
|
||||
if not l[0] in letters:
|
||||
break
|
||||
keyword, value = split(l[:-1], "=", 1)
|
||||
fields = split(l[:-1], "=", 1)
|
||||
if len(fields) != 2:
|
||||
sys.stderr.write('Error in configuration, I expect keyword=value line\n')
|
||||
sys.stderr.write('But I got instead:\n')
|
||||
sys.stderr.write(repr(l))
|
||||
sys.stderr.write('\n')
|
||||
sys.exit(1)
|
||||
keyword, value = fields
|
||||
keyword = lower(keyword)
|
||||
if keyword in ('colors', 'colour', 'color'):
|
||||
keyword = 'colours'
|
||||
|
|
Loading…
Reference in New Issue