@@ -122,23 +122,18 @@ endfunction
122
122
123
123
" TODO: can this whole command be simplified?
124
124
function ! man#grep#command (path_glob, insensitive_flag, pattern)
125
- let do_glob = ' ls ' .a: path_glob .' 2>/dev/null |'
126
-
125
+ let command = ' ls ' .a: path_glob .' 2>/dev/null |'
127
126
" xargs is used to feed manpages one-by-one
128
- let xargs = ' xargs -I{} -n1 sh -c "manpage={};'
129
-
127
+ let command .= ' xargs -I{} -n1 sh -c "manpage={};'
130
128
" inner variables execute within a shell started by xargs
131
- let inner_output_manfile = ' /usr/bin/man \$manpage 2>/dev/null|col -b|'
132
-
129
+ let command .= ' /usr/bin/man \$manpage 2>/dev/null|col -b|'
133
130
" if the first manpage line is blank, remove it (stupid semicolons are required)
134
- let inner_trim_whitespace = " sed '1 {;/^\s *$/d;}'|"
135
- let inner_grep = ' grep ' .a: insensitive_flag .' -nE ' .a: pattern .' |'
136
-
131
+ let command .= " sed '1 {;/^\s *$/d;}'|"
132
+ let command .= ' grep ' .a: insensitive_flag .' -nE ' .a: pattern .' |'
137
133
" prepending filename to each line of grep output, followed by a !
138
- let inner_append_filename = ' sed "s,^,\$manpage!,"'
139
- let end_quot = ' "'
140
-
141
- return do_glob.xargs.inner_output_manfile.inner_trim_whitespace.inner_grep.inner_append_filename.end_quot
134
+ let command .= ' sed "s,^,\$manpage!,"'
135
+ let command .= ' "'
136
+ return command
142
137
endfunction
143
138
144
139
" }}}
0 commit comments