From 981613d42b40a696d7f9b83312f9a8f16777e277 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 13:16:49 +0000 Subject: fcoe-utils-1.0.32 base --- diff --git a/contrib/bash_completion/fcoeadm b/contrib/bash_completion/fcoeadm new file mode 100644 index 0000000..59ed54b --- /dev/null +++ b/contrib/bash_completion/fcoeadm @@ -0,0 +1,76 @@ +# bash completion for fcoeadm +# +## fcoeadm --help +#Version 1.0.17 +#Usage: fcoeadm +# [-m|--mode fabric|vn2vn] [-c|--create] +# [-d|--destroy] +# [-r|--reset] +# [-S|--Scan] +# [-i|--interface] [] +# [-t|--target] [] +# [-l|--lun] [] +# [-s|--stats] [] +# [-v|--version] +# [-h|--help] + +# This file must be updated with any changes to, or additions to the options. + +# Could not get numeric value to work for the --stats interval +# Considered parsing output of --help to complete options + +have fcoeadm && _available_fcoe_interfaces() +{ + if [ "${1:-}" = -a ]; then + # list only devices that are up + COMPREPLY=( $( for f in /sys/class/net/* ; do if grep -q up $f/operstate ; then echo ${f##*/} ; fi ; done 2>/dev/null )) + else + # list all devices + COMPREPLY=( $( for f in /sys/class/net/* ; do echo ${f##*/} ; done 2>/dev/null )) + fi + + COMPREPLY=( $( compgen -W '${COMPREPLY[@]/%[[:punct:]]/}' -- "$cur" ) ) +} + + + + +have fcoeadm && _fcoeadm_options() +{ + local cur prev prev_prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="-m --mode -c --create -d --destroy -r --reset -i --interface -t --target -l --lun -s --stats -S --Scan -h --help -v --version" + + case "${prev}" in + -c|--create|-d|--destroy|-r|--reset|-s|--stats|-S|--Scan|-i|--interface|-t|--target|-l|--lun) + # only show interfaces that are up + _available_fcoe_interfaces -a + return 0 + ;; + -m|--mode) + COMPREPLY=( fabric vn2vn ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]/%[[:punct:]]/}' -- "$cur" ) ) + return 0 + ;; + esac + + case "${cur}" in + *) + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + ;; + esac + + return 0 +} +complete -F _fcoeadm_options fcoeadm + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff --git a/contrib/bash_completion/fcoemon b/contrib/bash_completion/fcoemon new file mode 100644 index 0000000..f2eec20 --- /dev/null +++ b/contrib/bash_completion/fcoemon @@ -0,0 +1,42 @@ +# bash completion for fcoemon +# + +## fcoemon --help +#Usage: fcoemon +# [-f|--foreground] +# [-d|--debug] +# [-s|--syslog] +# [-v|--version] +# [-h|--help] + +# This file must be updated with any changes to, or additions to the options. + +# Could not get numeric value to work for the --stats interval +# Considered parsing output of --help to complete options + +have fcoemon && _fcoemon_options() +{ + local cur prev prev_prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="-f --foreground -d --debug -s --syslog -v --version -h --help" + + case "${cur}" in + *) + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + ;; + esac + + return 0 +} +complete -F _fcoemon_options fcoemon + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..0b5f461 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,22 @@ +## known to work with asciidoc version 8.4.5 +## and the DocBook XSL Stylesheets version 1.75.2 + +MAN_8_TXT := fcoeadm.txt fcoemon.txt fipvlan.txt fcrls.txt fcnsq.txt fcping.txt +MAN_TXT := $(MAN_8_TXT) +MAN_8 := $(patsubst %.txt,%.8,$(MAN_8_TXT)) +MAN := $(MAN_8) +MAN_XML := $(patsubst %.txt,%.xml,$(MAN_TXT)) + +man: $(MAN) + +XSLTPROC_OPTS := --param man.justify 1 +A2X_OPTS := -d manpage --xsltproc-opts='$(XSLTPROC_OPTS)' + +%.8: %.txt + a2x -f manpage $(A2X_OPTS) $< + +clean: + rm -f $(MAN_XML) + +.DEFAULT_GOAL := man +.PHONY: man clean