1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

add a warning if newlines are detected in naked ls

This commit is contained in:
Kelly Brazil
2020-02-24 17:47:31 -08:00
parent c7b7f1a5dc
commit 961696c963

View File

@ -236,6 +236,7 @@ def parse(data, raw=False, quiet=False):
# Pop following total line
linedata.pop(0)
warned = False
new_section = False
if linedata:
@ -301,6 +302,10 @@ def parse(data, raw=False, quiet=False):
next_is_parent = False
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
if parent: