mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 19:41:15 -03:00
Fix other usages of \n in sed replacements.
This commit is contained in:
committed by
ridiculousfish
parent
1fa0c4d4d3
commit
01780f19b1
@@ -5,7 +5,11 @@ function __fish_complete_lpr_option --description 'Complete lpr option'
|
||||
set -l IFS =
|
||||
echo $optstr | read -l opt val
|
||||
set -l descr
|
||||
for l in (lpoptions -l ^ /dev/null | grep $opt | sed 's+\(.*\)/\(.*\):\s*\(.*\)$+\2 \3+; s/ /\n/g;')
|
||||
# Some seds (e.g. on Mac OS X), don't support \n in the RHS
|
||||
# Use a literal newline instead
|
||||
# http://sed.sourceforge.net/sedfaq4.html#s4.1
|
||||
for l in (lpoptions -l ^ /dev/null | grep $opt | sed 's+\(.*\)/\(.*\):\s*\(.*\)$+\2 \3+; s/ /\\
|
||||
/g;')
|
||||
if not set -q descr[1]
|
||||
set descr $l
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user