lsf: Add 'm' format specifier to show the MimeType

This commit is contained in:
Nick Craig-Wood
2018-05-13 10:37:25 +01:00
parent aadbcce486
commit f77efc7649
3 changed files with 15 additions and 0 deletions

View File

@ -1430,6 +1430,13 @@ func (l *ListFormat) AddID() {
})
}
// AddMimeType adds file's MimeType to the output if known
func (l *ListFormat) AddMimeType() {
l.AppendOutput(func() string {
return fs.MimeTypeDirEntry(l.entry)
})
}
// AppendOutput adds string generated by specific function to printed output
func (l *ListFormat) AppendOutput(functionToAppend func() string) {
if len(l.output) > 0 {