Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Controlling the order of -/g produced files and directories



On Aug 24,  6:34pm, Hannu Koivisto wrote:
} Subject: Controlling the order of -/g produced files and directories
}
} I'd like to make such a completion for my utgz and vtgz shell
} functions that it matches to *.tgz, *.tar.gz and directories.
} 
} compctl -/g '*.(tgz|tar.gz)' utgz vtgz
} 
} Although I didn't find explanation for this -/g option

That's not one option, it's two:
	-/
	-g '*.(tgz|tar.gz)'

It happens that you can run them together as -/g because -/ doesn't
take any additional arguments.  -/ means "complete filesystem paths."

} However, I would prefer that if some directory has both matching
} files and subdirectories then those files would be first in the
} list of completions and those directories last.

Zsh currently sorts the completion list itself, alphabetically; there
has been discussion of changing this on the developer's list, but at
the moment you can't force files to sort ahead of directories.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author