Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
192 - 1
# bash completion for lldptool
2
#
3
## lldptool --help
4
# lldptool v0.9.41
5
# Copyright (c) 2007-2010, Intel Corporation
6
#
7
# Substantially modified from:  hostapd_cli v 0.5.7
8
# Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi> and contributors
9
#
10
# Usage:
11
#   lldptool <command> [options] [arg]   general command line usage format
12
#   lldptool                             go into interactive mode
13
#            <command> [options] [arg]   general interactive command format
14
#
15
# Options:
16
#   -i [ifname]                          network interface
17
#   -V [tlvid]                           TLV identifier
18
#                                        may be numeric or keyword (see below)
19
#   -n                                   "neighbor" option for command
20
#   -a                                   "add" option for command
21
#   -d                                   "remove" option for command
22
#   -r                                   show raw message
23
#   -R                                   show only raw messages
24
#
25
# Commands:
26
#   license                              show license information
27
#   -h|help                              show command usage information
28
#   -v|version                           show version
29
#   -q|quit                              exit lldptool (interactive mode)
30
#   -S|stats                             get LLDP statistics for ifname
31
#   -t|get-tlv                           get TLVs from ifname
32
#   -T|set-tlv                           set arg for tlvid to value
33
#   -l|get-lldp                          get the LLDP parameters for ifname
34
#   -L|set-lldp                          set the LLDP parameter for ifname
35
 
36
# This file must be updated with any changes to, or additions to the options.
37
 
38
# Could not get numeric value to work for the --stats interval
39
# Considered parsing output of --help to complete options
40
 
41
have lldptool && _lldptool_options()
42
{
43
    local cur prev opts cmds opts_and_cmds
44
    COMPREPLY=()
45
    cur="${COMP_WORDS[COMP_CWORD]}"
46
    prev="${COMP_WORDS[COMP_CWORD-1]}"
47
    cmds="license -h help -v version -q quit -s stats -t get-tlv -T set-tlv -l get-lldp -L set-lldp"
48
    opts="-i -V -n -a -d -r -R"
49
    opts_and_cmds="$opts $cmds"
50
 
51
    case "${cur}" in
52
        *)
53
            COMPREPLY=( $(compgen -W "${opts_and_cmds}" -- ${cur}) )
54
	    ;;
55
    esac
56
 
57
    case "${prev}" in
58
        -i)
59
	    _available_interfaces
60
	    return 0
61
	    ;;
62
    esac
63
 
64
    return 0
65
}
66
complete -F _lldptool_options lldptool
67
 
68
# Local variables:
69
# mode: shell-script
70
# sh-basic-offset: 4
71
# sh-indent-comment: t
72
# indent-tabs-mode: nil
73
# End:
74
# ex: ts=4 sw=4 et filetype=sh