mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-15 01:24:29 +02:00
add a warning if newlines are detected in naked ls
This commit is contained in:
@ -236,6 +236,7 @@ def parse(data, raw=False, quiet=False):
|
|||||||
# Pop following total line
|
# Pop following total line
|
||||||
linedata.pop(0)
|
linedata.pop(0)
|
||||||
|
|
||||||
|
warned = False
|
||||||
new_section = False
|
new_section = False
|
||||||
|
|
||||||
if linedata:
|
if linedata:
|
||||||
@ -301,6 +302,10 @@ def parse(data, raw=False, quiet=False):
|
|||||||
next_is_parent = False
|
next_is_parent = False
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if not quiet and next_is_parent and not entry.endswith(':') and not warned:
|
||||||
|
jc.utils.warning_message('Newline characters detected. Filenames probably corrupted. Use ls -l instead.')
|
||||||
|
warned = True
|
||||||
|
|
||||||
output_line['filename'] = entry
|
output_line['filename'] = entry
|
||||||
|
|
||||||
if parent:
|
if parent:
|
||||||
|
Reference in New Issue
Block a user