-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
This is the way tree, ls, du, etc work:
% tree /dev/dri /dev/bus
/dev/dri
|-- by-path
| |-- pci-0000:00:02.0-card -> ../card1
| `-- pci-0000:00:02.0-render -> ../renderD128
|-- card1
`-- renderD128
/dev/bus
`-- usb
|-- 001
| |-- 001
| |-- 002
| `-- 003
|-- 002
| |-- 001
| `-- 002
|-- 003
| |-- 001
| `-- 002
|-- 004
| |-- 001
| `-- 002
|-- 005
| |-- 001
| `-- 002
`-- 006
`-- 001
10 directories, 16 files
%
% tree /dev/{dri,bus}
/dev/dri
|-- by-path
| |-- pci-0000:00:02.0-card -> ../card1
| `-- pci-0000:00:02.0-render -> ../renderD128
|-- card1
`-- renderD128
/dev/bus
`-- usb
|-- 001
| |-- 001
| |-- 002
| `-- 003
|-- 002
| |-- 001
| `-- 002
|-- 003
| |-- 001
| `-- 002
|-- 004
| |-- 001
| `-- 002
|-- 005
| |-- 001
| `-- 002
`-- 006
`-- 001
10 directories, 16 files
Would be great to have the same functionality in tre:
% tre /dev/dri /dev/bus
error: Found argument '/dev/bus' which wasn't expected, or isn't valid in this context
USAGE:
tre [OPTIONS] [PATH]
For more information try --help
%
% tre /dev/{dri,bus}
error: Found argument '/dev/bus' which wasn't expected, or isn't valid in this context
USAGE:
tre [OPTIONS] [PATH]
For more information try --help
Workaround
This works, if tossed into your init file:
tre() { printf '%s\0' "$@" | xargs -0 -n1 tre; }Test:
% tre /dev/{dri,bus} /tmp/has\ space
/dev/dri
├── by-path
│ ├── pci-0000:00:02.0-render
│ └── pci-0000:00:02.0-card
├── card1
└── renderD128
/dev/bus
└── usb
├── 006
│ └── 001
├── 005
│ ├── 002
│ └── 001
├── 004
│ ├── 002
│ └── 001
├── 002
│ ├── 002
│ └── 001
├── 003
│ ├── 002
│ └── 001
└── 001
├── 003
├── 002
└── 001
/tmp/has space
└── file.txt
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels