Merge pull request #588 from Eisfunke/master

Add completion script for wireguard's wg-quick
This commit is contained in:
nicoulaj 2018-10-13 23:45:08 +02:00 committed by GitHub
commit 84a820a798
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 0 deletions

25
src/_wg-quick Normal file
View File

@ -0,0 +1,25 @@
#compdef wg-quick
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for wg-quick (a script for easy managemant of wireguard
# VPN tunnels) (https://www.wireguard.com/)
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Nicolas Lenz <nicolas@eisfunke.com>
#
# ------------------------------------------------------------------------------
# The possible modes
local modes=('up\:"bring a wireguard interface up"'\
'down\:"tear down and remove a wireguard interface"'\
'save\:"save configuration of a running wireguard interface"')
# 1: Complete mode
# 2: Complete interface with all .conf files in /etc/wireguard without the filename extension.
_arguments "1:mode:((${modes}))"\
'2:interface:_path_files -W /etc/wireguard -g "*.conf(^/:r)"'