bin/tab_completion.sh.erb in markdown_exec-1.3.0 vs bin/tab_completion.sh.erb in markdown_exec-1.3.1

- old
+ new

@@ -28,10 +28,11 @@ # if [[ "${cur}" =~ ^\..+\.$ ]] ; then if [[ ${prev} == -* ]] ; then case $prev in <% svhs.each do |svh| + svn = svh[:long_name] if svn && svh[:arg_name] svn = '--' + svh[:long_name] if svh[:compreply] == false # nothing @@ -41,10 +42,25 @@ # nothing else %> <%= svn + ') COMPREPLY="' + svh[:compreply] + '"; return 0 ;;' %> <% end end + + svn = svh[:short_name] + if svn && svh[:arg_name] + svn = '-' + svh[:short_name] + if svh[:compreply] == false + # nothing + elsif svh[:compreply].nil? %> + <%= svn + ') __filedirs_all; return 0 ;;' %> + <% elsif svh[:compreply].empty? + # nothing + else %> + <%= svn + ') COMPREPLY="' + svh[:compreply] + '"; return 0 ;;' %> + <% end + end + end %> esac fi fi @@ -63,12 +79,19 @@ # stage 1: present option type # if [[ -z ${cur} ]] ; then case $prev in <% svhs.each do |svh| + svn = svh[:long_name] if svn && svh[:arg_name] svn = '--' + svh[:long_name] %> + <%= svn + ') COMPREPLY=".' + svh[:arg_name] + '."; return 0 ;;' %> + <% end + + svn = svh[:short_name] + if svn && svh[:arg_name] + svn = '-' + svh[:short_name] %> <%= svn + ') COMPREPLY=".' + svh[:arg_name] + '."; return 0 ;;' %> <% end end %> esac fi