Feature #16
More user friendly Einarc CLI
| Status: | New | Start: | 01/23/2009 | ||
| Priority: | Normal | Due date: | |||
| Assigned to: | - | % Done: | 70% |
||
| Category: | - | ||||
| Target version: | 1.5 | ||||
Description
- Make intelligent automatic guess for
--adapter: if there are no--adapterspecified and there is a single adapter in a system, use this one. - If einarc is called from interactive shell, use humanize automatically.
- Sort output of
adapter infosomehow. - "einarc" with only adapter specified (or guesses, see 1) now outputs bare
Object not specified
It should output something more useful, such as list of objects.
History
Updated by Andras Horvath 1107 days ago
Mikhail Yakshin wrote:
- Make intelligent automatic guess for
--adapter: if there are no--adapterspecified and there is a single adapter in a system, use this one.
or add a parameter --all-adapters or somesuch. It would be good for generic scripts, when one has no idea what adapter(s) are in a machine.
Updated by Mikhail Yakshin 1107 days ago
Andras Horvath wrote:
or add a parameter --all-adapters or somesuch. It would be good for generic scripts, when one has no idea what adapter(s) are in a machine.
In fact, it could be easily implemented in shell. einarc -l outputs a list of all adapters, for it could be just iterated over it. Something like:
einarc -l | cut -f1,2 | while read L; do
AD_TYPE=$(echo "$L" | cut -f1)
AD_NUM=$(echo "$L" | cut -f2)
einarc -t $AD_TYPE -a $AD_NUM "some sort of clever command here"
done
In fact, it's much more generic that --all-adapters, as it allows you to enter any number of arbitrary commands. However, we can improve this interface by making something like that:
for I in $(einarc --list-adapter-ids); do
einarc --adapter-id=$I "some sort of clever command here"
done
I.e. may be we should implement a special command to output distinct, whitespace-separated (newline-separated), clear universal adapter IDs. For example, we could pack "adapter module" and "adapter number" into single string, such as areca:1. Of course, the option names I've proposed are to be discussed, that's what I've got from the top of my head.
Updated by Mikhail Yakshin 925 days ago
- % Done changed from 0 to 50
Points 1 and 4 from original task are complete.
Updated by Mikhail Yakshin 892 days ago
- % Done changed from 50 to 70
- If einarc is called from interactive shell, use humanize automatically.
Done in r1680