Problem Statement
When sending multiple documents to the command line, the documents are not separated with line feeds. In fact, line-feeds between documents are removed.
One use case when working with multiple xml documents streamed to console is to get each document on a single line, allowing to pipe result to standard command line tools of interest such as simple grep for selecting / filtering documents.
Adding a new flag -ds / --document-separators with a numeral 0-n (default 0 for backwards compatibility) in a similar way as --indent is currently working.
Expected Result
# Current
➜ echo $' <element/> <element/> ' | xq
<element/><element/>
# Expected
➜ echo $' <element/> <element/> ' | xq
<element/><element/>
➜ echo $' <element/> <element/> ' | xq -ds 1
<element/>
<element/>
➜ echo $' <element/> <element/> ' | xq -ds 2
<element/>
<element/>
# Current
➜ echo $' <?xml version="1.0"?><element></element> \
<?xml version="1.0"?> <element/> ' | xq
<?xml version="1.0"?>
<element/><?xml version="1.0"?>
<element/>
# Expected
➜ echo $' <?xml version="1.0"?><element></element> \
<?xml version="1.0"?> <element/> ' | xq -ds 1
<?xml version="1.0"?>
<element/>
<?xml version="1.0"?>
<element/>
➜ echo $' <?xml version="1.0"?><element></element> \
<?xml version="1.0"?> <element/> ' | xq -ds 2
<?xml version="1.0"?>
<element/>
<?xml version="1.0"?>
<element/>
Problem Statement
When sending multiple documents to the command line, the documents are not separated with line feeds. In fact, line-feeds between documents are removed.
One use case when working with multiple xml documents streamed to console is to get each document on a single line, allowing to pipe result to standard command line tools of interest such as simple
grepfor selecting / filtering documents.Adding a new flag
-ds/--document-separatorswith a numeral 0-n (default 0 for backwards compatibility) in a similar way as--indentis currently working.Expected Result