Changeset 307


Ignore:
Timestamp:
Oct 19, 2017, 8:11:44 PM (7 years ago)
Author:
g7moreau
Message:
  • Better doc for exportsw option and better dynamic completion
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r306 r307  
    11221122
    11231123 klask updatesw [--verbose|-v]
    1124  klask exportsw [--format|-f txt|dot]
     1124 klask exportsw [--format|-f txt|dot] [--modulo|-m XX] [--shift|-s YY]
    11251125
    11261126 klask searchdb [--kind|-k host|mac] computer [mac-address]
     
    30583058
    30593059 klask updatesw [--verbose|-v]
    3060  klask exportsw [--format|-f txt|dot]
     3060 klask exportsw [--format|-f txt|dot] [--modulo|-m XX] [--shift|-s YY]
    30613061
    30623062 klask searchdb [--kind|-k host|mac] computer [mac-address]
     
    32323232=head2 exportsw
    32333233
    3234  klask exportsw [--format|-f txt|dot]
     3234 klask exportsw [--format|-f txt|dot] [--modulo|-m XX] [--shift|-s YY]
    32353235
    32363236This command print the content of the switch database. There is actually two format.
     
    32413241 dot -Tpng /tmp/map.dot > /tmp/map.png
    32423242
     3243In case you have too many switch connected on one switch,
     3244the graphviz result graph could be too much vertical.
     3245With C<--modulo> > 0, you can specify how many switches (connected on one switch) are on the same columns
     3246before shifting them to one column to the left and back again.
     3247The C<--shift> parameter must be 1, 2 or 3.
     3248With C<--shift> egual to 2, the shift will be to two column to the left.
     3249With 3, it will be 1 to the left and 2 to the left one time over two !
     3250In practise, we just add virtuals nodes in the dot file,
     3251that means the result graph is generated with theses virtuals but invisibles nodes...
    32433252
    32443253=head2 ip-free
  • trunk/klask.bash_completion

    r234 r307  
    2222         return 0
    2323         ;;
     24      -s|--shift)
     25         COMPREPLY=($(compgen -W "1 2 3" -- "$cur"))
     26         return 0
     27         ;;
    2428   esac
    2529
    26    if [[ "$cur" == -* ]]
     30   if [[ "$cur" == '-*' || $COMP_CWORD -gt 1 ]]
    2731   then
    28       COMPREPLY=($(compgen -W '-v --verbose -k --kind -f --format -d --day -i --vlan' -- "$cur"))
     32      #COMPREPLY=($(compgen -W '-v --verbose -k --kind -f --format -d --day -i --vlan -m --modulo -s --shift' -- "$cur"))
     33      COMPREPLY=($(compgen -W "$(klask  help|grep "^ klask ${COMP_WORDS[1]}" | sed -e 's/[\[]/\n/g;'|grep -- '^-'|cut -f 1 -d ']'|cut -f 1 -d ' '|sed -e 's/|/ /g;'|xargs echo -n)" -- "$cur"))
    2934   else
    3035      COMPREPLY=($(compgen -W "$($(which klask || echo /usr/sbin/klask) help|grep '^ klask'|awk '{print $2}'|xargs echo -n)" -- "$cur"))
Note: See TracChangeset for help on using the changeset viewer.