mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
lsf: implement 'i' format for showing object ID - fixes #1476
This commit is contained in:
@@ -1420,6 +1420,16 @@ func (l *ListFormat) AddHash(ht hash.Type) {
|
||||
})
|
||||
}
|
||||
|
||||
// AddID adds file's ID to the output if known
|
||||
func (l *ListFormat) AddID() {
|
||||
l.AppendOutput(func() string {
|
||||
if do, ok := l.entry.(fs.IDer); ok {
|
||||
return do.ID()
|
||||
}
|
||||
return ""
|
||||
})
|
||||
}
|
||||
|
||||
// AppendOutput adds string generated by specific function to printed output
|
||||
func (l *ListFormat) AppendOutput(functionToAppend func() string) {
|
||||
if len(l.output) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user