MissingSubmenuFunction / PipeRead: Problem with $1

When FVWM calls fvwm-menu-directory it passes an empty string as $1 instead of the second argument.
However when I call fvwm-menu-directory from command line like below in the way I’d expect FVWM to call it, it works as it should.

% fvwm-menu-directory -d '~' --func-name 'funcFiles' --filexts 'csv,csv,html,acgi,htm,htmls,htx,shtml,stm,mml,txt,text,conf,def,list,log,c,c++,cc,com,cxx,f,f90,for,g,h,hh,idc,jav,java,lst,m,mar,pl,sdml,bas,in,asc,diff,pot,el,ksh,rtf,tsv,xml,dot,lwp,wks,wp,wp6,oprc,otm,wpd,docm,dotx,ott,wdb,dotm,w6w,wiz,word,oth,wcm,doc,sgl,sxg,rtx,docx,wp5,odm,wps,stw,sxw,odt,pqa,pdb,sxm,mathml,odf,odft,odb,xhtml,xul,xht,wk,xld,xll,ots,xlsb,xlc,xla,xlb,123,xl,ods,xlt,odc,otc,wk1,xlm,xlw,xltm,xltx,xlv,xlsx,xls,stc,xlsm,xlk,sxc,xz,jar,rpm,cpio,cbt,tar,zip,cbz,cb7,rar,gzip,cab,sit,gtar,z,7z,cba,taz,tgz,lha,cbr,gz,bz,bcpio,boz,bz2,sv4cpio,sv4crc'
This is the menu in the fvwm config (created by my script):

[code]AddToMenu meowFiles MissingSubmenuFunction funcFiles

  • “Text” Popup ~ csv,csv,html,acgi,htm,htmls,htx,shtml,stm,mml,txt,text,conf,def,list,log,c,c++,cc,com,cxx,f,f90,for,g,h,hh,idc,jav,java,lst,m,mar,pl,sdml,bas,in,asc,diff,pot,el,ksh,rtf,tsv,xml,dot,lwp,wks,wp,wp6,oprc,otm,wpd,docm,dotx,ott,wdb,dotm,w6w,wiz,word,oth,wcm,doc,sgl,sxg,rtx,docx,wp5,odm,wps,stw,sxw,odt,pqa,pdb,sxm,mathml,odf,odft,odb,xhtml,xul,xht,wk,xld,xll,ots,xlsb,xlc,xla,xlb,123,xl,ods,xlt,odc,otc,wk1,xlm,xlw,xltm,xltx,xlv,xlsx,xls,stc,xlsm,xlk,sxc,xz,jar,rpm,cpio,cbt,tar,zip,cbz,cb7,rar,gzip,cab,sit,gtar,z,7z,cba,taz,tgz,lha,cbr,gz,bz,bcpio,boz,bz2,sv4cpio,sv4crc
  • “Image” Popup ~ bmp,bm,g3,gif,jpeg,jpg,jfif,jfif-tbnl,jpe,jfif,jpe,jpeg,jpg,png,x-png,svg,svgz,tiff,tif,rp,wbmp,ras,fh,fhc,fh4,fh5,fh7,ico,bmp,pcx,pnm,pbm,pgm,ppm,tga,xbm,xpm,xbm,xpm,pm,xwd,xbm,xpm,std,odg,sxd,vsd,vss,otg,vsw,vst,ani,pdf,ps,eps,ai,chm,oxps,xps,pot,pwz,pptx,otp,ppsx,potx,ppsm,sxi,ppz,sldx,odp,potm,pptm,ppt,pps,ppa,sti
  • “Audio” Popup ~ flac,mp4a,m4a,mpga,mp2,mp2a,mp3,m2a,mpa,mpg,m3a,mpega,m4a,m3u,oga,ogg,spx,weba,snd,flac,mka,mp2,m3u,wax,wma,ram,ra,rm,rmm,rmp,rmp,ra,rpm,pls,wav
  • “Video” Popup ~ avi,mp4,mp4v,mpg4,mpeg,mpg,mpe,m1v,m2v,mp2,mp3,mpa,mpv2,avi,qt,moov,mov,rv,webm,fli,flv,mkv,mk3d,mks,mp2,mp3,asf,asx,asr,wmv,avi,rm,m2a,ra,m4a,pls,m3a,oga,mp2a,wav,mp4a,ogg,rmm,spx,snd,m3u,flac,mpga,rmp,wma,ram,mka,mpega,ogx,wax,rp,weba,xspf,rpm,swfl,swf
  • “All” Popup ~ *

AddToFunc funcFiles

  • I PipeRead “fvwm-menu-directory -d ‘$0’ --func-name ‘funcFiles’ --filexts ‘$1’”[/code]
    Any idea what mistake I made?

Wrote a kludge to fix the issue.
Then found out that there can be additional Popup options. Maybe the first Popup option is the menu name, to be put in apostrophs to be allowed to contain whitespace and separated into multiple arguments $0, $1, …, Sn when being passed to an external program?
Anyway the kludge works for now and I’ll keep it until some fvwm guru told about how to do this in a clean manner.

The kludged menu/function section now looks this way:

[code]AddToMenu meowFiles MissingSubmenuFunction funcFiles

  • “Text” Popup “dir=/usr/home/meow;filexts=csv,csv,html,acgi,htm,htmls,htx,shtml,stm,mml,txt,text,conf,def,list,log,c,c++,cc,com,cxx,f,f90,for,g,h,hh,idc,jav,java,lst,m,mar,pl,sdml,bas,in,asc,diff,pot,el,ksh,rtf,tsv,xml,dotm,wiz,oth,sxw,pqa,wp6,oprc,pdb,dotx,ott,wdb,odm,wp,dot,wps,wp5,wks,sxg,docx,odt,w6w,docm,rtx,wcm,doc,otm,wpd,lwp,stw,sgl,word,mathml,odft,sxm,odf,odb,xul,xhtml,xht,xll,xlv,xlsb,wk,xlb,xlc,sxc,xlt,xls,ots,xltx,xlw,xlk,123,stc,xlm,xltm,xlsx,odc,ods,xla,otc,wk1,xl,xlsm,xld,z,rar,cbr,gzip,7z,bz,jar,taz,lha,rpm,gtar,zip,gz,xz,cb7,tgz,tar,cab,sit,cbt,cbz,cba,cpio,sv4crc,sv4cpio,bz2,bcpio,boz”
  • “Image” Popup “dir=/usr/home/meow;filexts=bmp,bm,g3,gif,jpeg,jpg,jfif,jfif-tbnl,jpe,jfif,jpe,jpeg,jpg,png,x-png,svg,svgz,tiff,tif,rp,wbmp,ras,fh,fhc,fh4,fh5,fh7,ico,bmp,pcx,pnm,pbm,pgm,ppm,tga,xbm,xpm,xbm,xpm,pm,xwd,xbm,xpm,vst,vsd,otg,sxd,vss,vsw,std,odg,ani,pdf,eps,ai,ps,chm,oxps,xps,ppz,ppsm,otp,pwz,sldx,pptx,sti,pptm,sxi,pot,ppa,potx,potm,ppsx,ppt,pps,odp”
  • “Audio” Popup “dir=/usr/home/meow;filexts=flac,mp4a,m4a,mpga,mp2,mp2a,mp3,m2a,mpa,mpg,m3a,mpega,m4a,m3u,oga,ogg,spx,weba,snd,flac,mka,mp2,m3u,wax,wma,ram,ra,rm,rmm,rmp,rmp,ra,rpm,pls,wav”
  • “Video” Popup “dir=/usr/home/meow;filexts=avi,mp4,mp4v,mpg4,mpeg,mpg,mpe,m1v,m2v,mp2,mp3,mpa,mpv2,avi,qt,moov,mov,rv,webm,fli,flv,mkv,mk3d,mks,mp2,mp3,asf,asx,asr,wmv,avi,snd,m3a,wav,m4a,rm,m2a,rmp,flac,mka,oga,ogg,pls,mp4a,ra,ram,mpega,spx,wma,rmm,m3u,mpga,mp2a,weba,swf,swfl,rpm,ogx,wax,xspf,rp”
  • “All” Popup “dir=/usr/home/meow;filexts=*”

AddToFunc funcFiles

  • I PipeRead “fvwm-menu-directory --func-name ‘funcFiles’ --kludge ‘$0’”[/code]