Feature #16

avatar

More user friendly Einarc CLI

Added by Mikhail Yakshin 3251 days ago. Updated 1511 days ago.

Status:Closed Start:01/23/2009
Priority:Normal Due date:
Assigned to:avatarMikhail Yakshin % Done:

70%

Category:-
Target version:2.0

Description

  • Make intelligent automatic guess for --adapter: if there are no --adapter specified 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 info somehow.
  • "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 3250 days ago

avatar

Mikhail Yakshin wrote:

  • Make intelligent automatic guess for --adapter: if there are no --adapter specified 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 3250 days ago

avatar

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 3067 days ago

avatar
  • % Done changed from 0 to 50

Points 1 and 4 from original task are complete.

Updated by Mikhail Yakshin 3035 days ago

avatar
  • % Done changed from 50 to 70
  1. If einarc is called from interactive shell, use humanize automatically.

Done in r1680

Updated by Mikhail Yakshin 1511 days ago

avatar
  • Status changed from New to Closed
  • Assigned to set to Mikhail Yakshin

Mostly implemented in 2.0. adapter info should became a target of a major overhaul, not just sorting fix.

Also available in: Atom PDF