meta: release v1.5.3-beta.1

pull/186/head v1.5.3-beta.1
Jake McGinty 2022-01-11 14:18:19 -06:00
parent 1b260823f9
commit b15b541669
21 changed files with 534 additions and 1008 deletions

10
Cargo.lock generated
View File

@ -152,7 +152,7 @@ dependencies = [
[[package]] [[package]]
name = "client" name = "client"
version = "1.5.2" version = "1.5.3-beta.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap 3.0.6", "clap 3.0.6",
@ -667,7 +667,7 @@ dependencies = [
[[package]] [[package]]
name = "netlink-request" name = "netlink-request"
version = "1.5.2" version = "1.5.3-beta.1"
dependencies = [ dependencies = [
"netlink-packet-core", "netlink-packet-core",
"netlink-packet-generic", "netlink-packet-generic",
@ -955,7 +955,7 @@ dependencies = [
[[package]] [[package]]
name = "server" name = "server"
version = "1.5.2" version = "1.5.3-beta.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
@ -990,7 +990,7 @@ dependencies = [
[[package]] [[package]]
name = "shared" name = "shared"
version = "1.5.2" version = "1.5.3-beta.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"atty", "atty",
@ -1373,7 +1373,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]] [[package]]
name = "wireguard-control" name = "wireguard-control"
version = "1.5.2" version = "1.5.3-beta.1"
dependencies = [ dependencies = [
"base64", "base64",
"curve25519-dalek", "curve25519-dalek",

View File

@ -214,10 +214,10 @@ brew install tonarino/innernet/innernet
```sh ```sh
# to install innernet: # to install innernet:
cargo install --git https://github.com/tonarino/innernet --tag v1.5.2 client cargo install --git https://github.com/tonarino/innernet --tag v1.5.3-beta.1 client
# to install innernet-server: # to install innernet-server:
cargo install --git https://github.com/tonarino/innernet --tag v1.5.2 server cargo install --git https://github.com/tonarino/innernet --tag v1.5.3-beta.1 server
``` ```
Note that you'll be responsible for updating manually. Note that you'll be responsible for updating manually.

View File

@ -7,7 +7,7 @@ license = "MIT"
name = "client" name = "client"
publish = false publish = false
repository = "https://github.com/tonarino/innernet" repository = "https://github.com/tonarino/innernet"
version = "1.5.2" version = "1.5.3-beta.1"
[[bin]] [[bin]]
name = "innernet" name = "innernet"

View File

@ -1,38 +1,40 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
.TH INNERNET-SERVER "8" "December 2021" "innernet-server 1.5.2" "System Administration Utilities" .TH INNERNET-SERVER "8" "January 2022" "innernet-server 1.5.3-beta.1" "System Administration Utilities"
.SH NAME .SH NAME
innernet-server \- manual page for innernet-server 1.5.2 innernet-server \- manual page for innernet-server 1.5.3-beta.1
.SH DESCRIPTION .SH DESCRIPTION
innernet\-server 1.5.2 innernet\-server 1.5.3\-beta.1
Jake McGinty <me@jake.su>
A server to coordinate innernet networks. A server to coordinate innernet networks.
.SS "USAGE:" .SS "USAGE:"
.IP .IP
innernet\-server [OPTIONS] <SUBCOMMAND> innernet\-server [OPTIONS] <SUBCOMMAND>
.SS "OPTIONS:" .SS "OPTIONS:"
.TP .TP
\fB\-c\fR, \fB\-\-config\-dir\fR <config\-dir> \fB\-c\fR, \fB\-\-config\-dir\fR <CONFIG_DIR>
[default: /etc/innernet\-server] [default: /etc/innernet\-server]
.TP .TP
\fB\-d\fR, \fB\-\-data\-dir\fR <data\-dir> \fB\-d\fR, \fB\-\-data\-dir\fR <DATA_DIR>
[default: /var/lib/innernet\-server] [default: /var/lib/innernet\-server]
.TP .TP
\fB\-\-no\-routing\fR \fB\-\-no\-routing\fR
Whether the routing should be done by innernet or is done by an external tool like Whether the routing should be done by innernet or is done by an
e.g. babeld external tool like e.g. babeld
.TP .TP
\fB\-\-backend\fR <backend> \fB\-\-backend\fR <BACKEND>
Specify a WireGuard backend to use. If not set, innernet will auto\-select based on Specify a WireGuard backend to use. If not set, innernet will
availability [default: kernel] [possible values: kernel, userspace] auto\-select based on availability [default: kernel] [possible
values: kernel, userspace]
.TP .TP
\fB\-\-mtu\fR <mtu> \fB\-\-mtu\fR <MTU>
Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for Specify the desired MTU for your interface (default: 1420 for
IPv6) IPv4 and 1400 for IPv6)
.TP .TP
\fB\-h\fR, \fB\-\-help\fR \fB\-h\fR, \fB\-\-help\fR
Prints help information Print help information
.TP .TP
\fB\-V\fR, \fB\-\-version\fR \fB\-V\fR, \fB\-\-version\fR
Prints version information Print version information
.SS "SUBCOMMANDS:" .SS "SUBCOMMANDS:"
.TP .TP
new new
@ -60,4 +62,4 @@ completions
Generate shell completion scripts Generate shell completion scripts
.TP .TP
help help
Prints this message or the help of the given subcommand(s) Print this message or the help of the given subcommand(s)

Binary file not shown.

View File

@ -9,10 +9,9 @@ _innernet-server() {
for i in ${COMP_WORDS[@]} for i in ${COMP_WORDS[@]}
do do
case "${i}" in case "${i}" in
innernet-server) "$1")
cmd="innernet-server" cmd="innernet__server"
;; ;;
add-cidr) add-cidr)
cmd+="__add__cidr" cmd+="__add__cidr"
;; ;;
@ -28,9 +27,6 @@ _innernet-server() {
help) help)
cmd+="__help" cmd+="__help"
;; ;;
init)
cmd+="__init"
;;
new) new)
cmd+="__new" cmd+="__new"
;; ;;
@ -49,19 +45,18 @@ _innernet-server() {
done done
case "${cmd}" in case "${cmd}" in
innernet-server) innernet__server)
opts=" -h -V -c -d --no-routing --help --version --config-dir --data-dir --backend --mtu new uninstall serve add-peer rename-peer add-cidr delete-cidr completions help init" opts="-h -V -c -d --help --version --config-dir --data-dir --no-routing --backend --mtu new uninstall serve add-peer rename-peer add-cidr delete-cidr completions help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--config-dir) --config-dir)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
;; ;;
-c) -c)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
;; ;;
@ -69,7 +64,7 @@ _innernet-server() {
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
;; ;;
-d) -d)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
;; ;;
@ -88,15 +83,13 @@ _innernet-server() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
;; ;;
innernet__server__add__cidr) innernet__server__add__cidr)
opts=" -h -V --yes --help --version --name --cidr --parent <interface> " opts="-h --name --cidr --parent --yes --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--name) --name)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
@ -117,13 +110,12 @@ _innernet-server() {
return 0 return 0
;; ;;
innernet__server__add__peer) innernet__server__add__peer)
opts=" -h -V --auto-ip --yes --help --version --name --ip --cidr --admin --save-config --invite-expires <interface> " opts="-h --name --ip --auto-ip --cidr --admin --yes --save-config --invite-expires --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--name) --name)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
@ -156,13 +148,12 @@ _innernet-server() {
return 0 return 0
;; ;;
innernet__server__completions) innernet__server__completions)
opts=" -h -V --help --version <shell> " opts="-h --help bash elvish fish powershell zsh"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;
@ -171,13 +162,12 @@ _innernet-server() {
return 0 return 0
;; ;;
innernet__server__delete__cidr) innernet__server__delete__cidr)
opts=" -h -V --yes --help --version --name <interface> " opts="-h --name --yes --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--name) --name)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
@ -190,44 +180,12 @@ _innernet-server() {
return 0 return 0
;; ;;
innernet__server__help) innernet__server__help)
opts=" -h -V --help --version " opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
innernet__server__init)
opts=" -h -V --auto-external-endpoint --help --version --network-name --network-cidr --external-endpoint --listen-port "
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--network-name)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--network-cidr)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--external-endpoint)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--listen-port)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;
@ -236,13 +194,12 @@ _innernet-server() {
return 0 return 0
;; ;;
innernet__server__new) innernet__server__new)
opts=" -h -V --auto-external-endpoint --help --version --network-name --network-cidr --external-endpoint --listen-port " opts="-h --network-name --network-cidr --external-endpoint --auto-external-endpoint --listen-port --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--network-name) --network-name)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
@ -267,13 +224,12 @@ _innernet-server() {
return 0 return 0
;; ;;
innernet__server__rename__peer) innernet__server__rename__peer)
opts=" -h -V --yes --help --version --name --new-name <interface> " opts="-h --name --new-name --yes --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--name) --name)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
@ -290,13 +246,12 @@ _innernet-server() {
return 0 return 0
;; ;;
innernet__server__serve) innernet__server__serve)
opts=" -h -V --no-routing --help --version --backend --mtu <interface> " opts="-h --no-routing --backend --mtu --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--backend) --backend)
COMPREPLY=($(compgen -W "kernel userspace" -- "${cur}")) COMPREPLY=($(compgen -W "kernel userspace" -- "${cur}"))
return 0 return 0
@ -313,13 +268,12 @@ _innernet-server() {
return 0 return 0
;; ;;
innernet__server__uninstall) innernet__server__uninstall)
opts=" -h -V --help --version <interface> " opts="-h --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;

View File

@ -1,19 +1,22 @@
edit:completion:arg-completer[innernet-server] = [@words]{ use builtin;
use str;
set edit:completion:arg-completer[innernet-server] = [@words]{
fn spaces [n]{ fn spaces [n]{
repeat $n ' ' | joins '' builtin:repeat $n ' ' | str:join ''
} }
fn cand [text desc]{ fn cand [text desc]{
edit:complex-candidate $text &display-suffix=' '(spaces (- 14 (wcswidth $text)))$desc edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
} }
command = 'innernet-server' var command = 'innernet-server'
for word $words[1:-1] { for word $words[1..-1] {
if (has-prefix $word '-') { if (str:has-prefix $word '-') {
break break
} }
command = $command';'$word set command = $command';'$word
} }
completions = [ var completions = [
&'innernet-server'= { &'innernet-server'= {
cand -c 'c' cand -c 'c'
cand --config-dir 'config-dir' cand --config-dir 'config-dir'
@ -21,11 +24,11 @@ edit:completion:arg-completer[innernet-server] = [@words]{
cand --data-dir 'data-dir' cand --data-dir 'data-dir'
cand --backend 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability' cand --backend 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability'
cand --mtu 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)' cand --mtu 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)'
cand -h 'Print help information'
cand --help 'Print help information'
cand -V 'Print version information'
cand --version 'Print version information'
cand --no-routing 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld' cand --no-routing 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand new 'Create a new network' cand new 'Create a new network'
cand uninstall 'Permanently uninstall a created network, rendering it unusable. Use with care' cand uninstall 'Permanently uninstall a created network, rendering it unusable. Use with care'
cand serve 'Serve the coordinating server for an existing network' cand serve 'Serve the coordinating server for an existing network'
@ -34,7 +37,7 @@ edit:completion:arg-completer[innernet-server] = [@words]{
cand add-cidr 'Add a new CIDR to an existing network' cand add-cidr 'Add a new CIDR to an existing network'
cand delete-cidr 'Delete a CIDR' cand delete-cidr 'Delete a CIDR'
cand completions 'Generate shell completion scripts' cand completions 'Generate shell completion scripts'
cand help 'Prints this message or the help of the given subcommand(s)' cand help 'Print this message or the help of the given subcommand(s)'
} }
&'innernet-server;new'= { &'innernet-server;new'= {
cand --network-name 'The network name (ex: evilcorp)' cand --network-name 'The network name (ex: evilcorp)'
@ -42,25 +45,19 @@ edit:completion:arg-completer[innernet-server] = [@words]{
cand --external-endpoint 'This server''s external endpoint (ex: 100.100.100.100:51820)' cand --external-endpoint 'This server''s external endpoint (ex: 100.100.100.100:51820)'
cand --listen-port 'Port to listen on (for the WireGuard interface)' cand --listen-port 'Port to listen on (for the WireGuard interface)'
cand --auto-external-endpoint 'Auto-resolve external endpoint' cand --auto-external-endpoint 'Auto-resolve external endpoint'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet-server;uninstall'= { &'innernet-server;uninstall'= {
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet-server;serve'= { &'innernet-server;serve'= {
cand --backend 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability' cand --backend 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability'
cand --mtu 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)' cand --mtu 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)'
cand --no-routing 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld' cand --no-routing 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet-server;add-peer'= { &'innernet-server;add-peer'= {
cand --name 'Name of new peer' cand --name 'Name of new peer'
@ -71,49 +68,35 @@ edit:completion:arg-completer[innernet-server] = [@words]{
cand --invite-expires 'Invite expiration period (eg. ''30d'', ''7w'', ''2h'', ''60m'', ''1000s'')' cand --invite-expires 'Invite expiration period (eg. ''30d'', ''7w'', ''2h'', ''60m'', ''1000s'')'
cand --auto-ip 'Auto-assign the peer the first available IP within the CIDR' cand --auto-ip 'Auto-assign the peer the first available IP within the CIDR'
cand --yes 'Bypass confirmation' cand --yes 'Bypass confirmation'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet-server;rename-peer'= { &'innernet-server;rename-peer'= {
cand --name 'Name of peer to rename' cand --name 'Name of peer to rename'
cand --new-name 'The new name of the peer' cand --new-name 'The new name of the peer'
cand --yes 'Bypass confirmation' cand --yes 'Bypass confirmation'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet-server;add-cidr'= { &'innernet-server;add-cidr'= {
cand --name 'The CIDR name (eg. ''engineers'')' cand --name 'The CIDR name (eg. ''engineers'')'
cand --cidr 'The CIDR network (eg. ''10.42.5.0/24'')' cand --cidr 'The CIDR network (eg. ''10.42.5.0/24'')'
cand --parent 'The CIDR parent name' cand --parent 'The CIDR parent name'
cand --yes 'Bypass confirmation' cand --yes 'Bypass confirmation'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet-server;delete-cidr'= { &'innernet-server;delete-cidr'= {
cand --name 'The CIDR name (eg. ''engineers'')' cand --name 'The CIDR name (eg. ''engineers'')'
cand --yes 'Bypass confirmation' cand --yes 'Bypass confirmation'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet-server;completions'= { &'innernet-server;completions'= {
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet-server;help'= { &'innernet-server;help'= {
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
] ]
$completions[$command] $completions[$command]

View File

@ -1,10 +1,10 @@
complete -c innernet-server -n "__fish_use_subcommand" -s c -l config-dir complete -c innernet-server -n "__fish_use_subcommand" -s c -l config-dir -r
complete -c innernet-server -n "__fish_use_subcommand" -s d -l data-dir complete -c innernet-server -n "__fish_use_subcommand" -s d -l data-dir -r
complete -c innernet-server -n "__fish_use_subcommand" -l backend -d 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability' -r -f -a "kernel userspace" complete -c innernet-server -n "__fish_use_subcommand" -l backend -d 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability' -r -f -a "{kernel ,userspace }"
complete -c innernet-server -n "__fish_use_subcommand" -l mtu -d 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)' complete -c innernet-server -n "__fish_use_subcommand" -l mtu -d 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)' -r
complete -c innernet-server -n "__fish_use_subcommand" -s h -l help -d 'Print help information'
complete -c innernet-server -n "__fish_use_subcommand" -s V -l version -d 'Print version information'
complete -c innernet-server -n "__fish_use_subcommand" -l no-routing -d 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld' complete -c innernet-server -n "__fish_use_subcommand" -l no-routing -d 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld'
complete -c innernet-server -n "__fish_use_subcommand" -s h -l help -d 'Prints help information'
complete -c innernet-server -n "__fish_use_subcommand" -s V -l version -d 'Prints version information'
complete -c innernet-server -n "__fish_use_subcommand" -f -a "new" -d 'Create a new network' complete -c innernet-server -n "__fish_use_subcommand" -f -a "new" -d 'Create a new network'
complete -c innernet-server -n "__fish_use_subcommand" -f -a "uninstall" -d 'Permanently uninstall a created network, rendering it unusable. Use with care' complete -c innernet-server -n "__fish_use_subcommand" -f -a "uninstall" -d 'Permanently uninstall a created network, rendering it unusable. Use with care'
complete -c innernet-server -n "__fish_use_subcommand" -f -a "serve" -d 'Serve the coordinating server for an existing network' complete -c innernet-server -n "__fish_use_subcommand" -f -a "serve" -d 'Serve the coordinating server for an existing network'
@ -13,47 +13,37 @@ complete -c innernet-server -n "__fish_use_subcommand" -f -a "rename-peer" -d 'R
complete -c innernet-server -n "__fish_use_subcommand" -f -a "add-cidr" -d 'Add a new CIDR to an existing network' complete -c innernet-server -n "__fish_use_subcommand" -f -a "add-cidr" -d 'Add a new CIDR to an existing network'
complete -c innernet-server -n "__fish_use_subcommand" -f -a "delete-cidr" -d 'Delete a CIDR' complete -c innernet-server -n "__fish_use_subcommand" -f -a "delete-cidr" -d 'Delete a CIDR'
complete -c innernet-server -n "__fish_use_subcommand" -f -a "completions" -d 'Generate shell completion scripts' complete -c innernet-server -n "__fish_use_subcommand" -f -a "completions" -d 'Generate shell completion scripts'
complete -c innernet-server -n "__fish_use_subcommand" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)' complete -c innernet-server -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c innernet-server -n "__fish_seen_subcommand_from new" -l network-name -d 'The network name (ex: evilcorp)' complete -c innernet-server -n "__fish_seen_subcommand_from new" -l network-name -d 'The network name (ex: evilcorp)' -r
complete -c innernet-server -n "__fish_seen_subcommand_from new" -l network-cidr -d 'The network CIDR (ex: 10.42.0.0/16)' complete -c innernet-server -n "__fish_seen_subcommand_from new" -l network-cidr -d 'The network CIDR (ex: 10.42.0.0/16)' -r
complete -c innernet-server -n "__fish_seen_subcommand_from new" -l external-endpoint -d 'This server\'s external endpoint (ex: 100.100.100.100:51820)' complete -c innernet-server -n "__fish_seen_subcommand_from new" -l external-endpoint -d 'This server\'s external endpoint (ex: 100.100.100.100:51820)' -r
complete -c innernet-server -n "__fish_seen_subcommand_from new" -l listen-port -d 'Port to listen on (for the WireGuard interface)' complete -c innernet-server -n "__fish_seen_subcommand_from new" -l listen-port -d 'Port to listen on (for the WireGuard interface)' -r
complete -c innernet-server -n "__fish_seen_subcommand_from new" -l auto-external-endpoint -d 'Auto-resolve external endpoint' complete -c innernet-server -n "__fish_seen_subcommand_from new" -l auto-external-endpoint -d 'Auto-resolve external endpoint'
complete -c innernet-server -n "__fish_seen_subcommand_from new" -s h -l help -d 'Prints help information' complete -c innernet-server -n "__fish_seen_subcommand_from new" -s h -l help -d 'Print help information'
complete -c innernet-server -n "__fish_seen_subcommand_from new" -s V -l version -d 'Prints version information' complete -c innernet-server -n "__fish_seen_subcommand_from uninstall" -s h -l help -d 'Print help information'
complete -c innernet-server -n "__fish_seen_subcommand_from uninstall" -s h -l help -d 'Prints help information' complete -c innernet-server -n "__fish_seen_subcommand_from serve" -l backend -d 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability' -r -f -a "{kernel ,userspace }"
complete -c innernet-server -n "__fish_seen_subcommand_from uninstall" -s V -l version -d 'Prints version information' complete -c innernet-server -n "__fish_seen_subcommand_from serve" -l mtu -d 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)' -r
complete -c innernet-server -n "__fish_seen_subcommand_from serve" -l backend -d 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability' -r -f -a "kernel userspace"
complete -c innernet-server -n "__fish_seen_subcommand_from serve" -l mtu -d 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)'
complete -c innernet-server -n "__fish_seen_subcommand_from serve" -l no-routing -d 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld' complete -c innernet-server -n "__fish_seen_subcommand_from serve" -l no-routing -d 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld'
complete -c innernet-server -n "__fish_seen_subcommand_from serve" -s h -l help -d 'Prints help information' complete -c innernet-server -n "__fish_seen_subcommand_from serve" -s h -l help -d 'Print help information'
complete -c innernet-server -n "__fish_seen_subcommand_from serve" -s V -l version -d 'Prints version information' complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l name -d 'Name of new peer' -r
complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l name -d 'Name of new peer' complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l ip -d 'Specify desired IP of new peer (within parent CIDR)' -r
complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l ip -d 'Specify desired IP of new peer (within parent CIDR)' complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l cidr -d 'Name of CIDR to add new peer under' -r
complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l cidr -d 'Name of CIDR to add new peer under' complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l admin -d 'Make new peer an admin?' -r
complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l admin -d 'Make new peer an admin?' complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l save-config -d 'Save the config to the given location' -r
complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l save-config -d 'Save the config to the given location' complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l invite-expires -d 'Invite expiration period (eg. \'30d\', \'7w\', \'2h\', \'60m\', \'1000s\')' -r
complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l invite-expires -d 'Invite expiration period (eg. \'30d\', \'7w\', \'2h\', \'60m\', \'1000s\')'
complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l auto-ip -d 'Auto-assign the peer the first available IP within the CIDR' complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l auto-ip -d 'Auto-assign the peer the first available IP within the CIDR'
complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l yes -d 'Bypass confirmation' complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -l yes -d 'Bypass confirmation'
complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -s h -l help -d 'Prints help information' complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -s h -l help -d 'Print help information'
complete -c innernet-server -n "__fish_seen_subcommand_from add-peer" -s V -l version -d 'Prints version information' complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -l name -d 'Name of peer to rename' -r
complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -l name -d 'Name of peer to rename' complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -l new-name -d 'The new name of the peer' -r
complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -l new-name -d 'The new name of the peer'
complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -l yes -d 'Bypass confirmation' complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -l yes -d 'Bypass confirmation'
complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -s h -l help -d 'Prints help information' complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -s h -l help -d 'Print help information'
complete -c innernet-server -n "__fish_seen_subcommand_from rename-peer" -s V -l version -d 'Prints version information' complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l name -d 'The CIDR name (eg. \'engineers\')' -r
complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l name -d 'The CIDR name (eg. \'engineers\')' complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l cidr -d 'The CIDR network (eg. \'10.42.5.0/24\')' -r
complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l cidr -d 'The CIDR network (eg. \'10.42.5.0/24\')' complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l parent -d 'The CIDR parent name' -r
complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l parent -d 'The CIDR parent name'
complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l yes -d 'Bypass confirmation' complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -l yes -d 'Bypass confirmation'
complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -s h -l help -d 'Prints help information' complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -s h -l help -d 'Print help information'
complete -c innernet-server -n "__fish_seen_subcommand_from add-cidr" -s V -l version -d 'Prints version information' complete -c innernet-server -n "__fish_seen_subcommand_from delete-cidr" -l name -d 'The CIDR name (eg. \'engineers\')' -r
complete -c innernet-server -n "__fish_seen_subcommand_from delete-cidr" -l name -d 'The CIDR name (eg. \'engineers\')'
complete -c innernet-server -n "__fish_seen_subcommand_from delete-cidr" -l yes -d 'Bypass confirmation' complete -c innernet-server -n "__fish_seen_subcommand_from delete-cidr" -l yes -d 'Bypass confirmation'
complete -c innernet-server -n "__fish_seen_subcommand_from delete-cidr" -s h -l help -d 'Prints help information' complete -c innernet-server -n "__fish_seen_subcommand_from delete-cidr" -s h -l help -d 'Print help information'
complete -c innernet-server -n "__fish_seen_subcommand_from delete-cidr" -s V -l version -d 'Prints version information' complete -c innernet-server -n "__fish_seen_subcommand_from completions" -s h -l help -d 'Print help information'
complete -c innernet-server -n "__fish_seen_subcommand_from completions" -s h -l help -d 'Prints help information'
complete -c innernet-server -n "__fish_seen_subcommand_from completions" -s V -l version -d 'Prints version information'
complete -c innernet-server -n "__fish_seen_subcommand_from help" -s h -l help -d 'Prints help information'
complete -c innernet-server -n "__fish_seen_subcommand_from help" -s V -l version -d 'Prints version information'

View File

@ -26,11 +26,11 @@ Register-ArgumentCompleter -Native -CommandName 'innernet-server' -ScriptBlock {
[CompletionResult]::new('--data-dir', 'data-dir', [CompletionResultType]::ParameterName, 'data-dir') [CompletionResult]::new('--data-dir', 'data-dir', [CompletionResultType]::ParameterName, 'data-dir')
[CompletionResult]::new('--backend', 'backend', [CompletionResultType]::ParameterName, 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability') [CompletionResult]::new('--backend', 'backend', [CompletionResultType]::ParameterName, 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability')
[CompletionResult]::new('--mtu', 'mtu', [CompletionResultType]::ParameterName, 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)') [CompletionResult]::new('--mtu', 'mtu', [CompletionResultType]::ParameterName, 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
[CompletionResult]::new('--no-routing', 'no-routing', [CompletionResultType]::ParameterName, 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld') [CompletionResult]::new('--no-routing', 'no-routing', [CompletionResultType]::ParameterName, 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('new', 'new', [CompletionResultType]::ParameterValue, 'Create a new network') [CompletionResult]::new('new', 'new', [CompletionResultType]::ParameterValue, 'Create a new network')
[CompletionResult]::new('uninstall', 'uninstall', [CompletionResultType]::ParameterValue, 'Permanently uninstall a created network, rendering it unusable. Use with care') [CompletionResult]::new('uninstall', 'uninstall', [CompletionResultType]::ParameterValue, 'Permanently uninstall a created network, rendering it unusable. Use with care')
[CompletionResult]::new('serve', 'serve', [CompletionResultType]::ParameterValue, 'Serve the coordinating server for an existing network') [CompletionResult]::new('serve', 'serve', [CompletionResultType]::ParameterValue, 'Serve the coordinating server for an existing network')
@ -39,7 +39,7 @@ Register-ArgumentCompleter -Native -CommandName 'innernet-server' -ScriptBlock {
[CompletionResult]::new('add-cidr', 'add-cidr', [CompletionResultType]::ParameterValue, 'Add a new CIDR to an existing network') [CompletionResult]::new('add-cidr', 'add-cidr', [CompletionResultType]::ParameterValue, 'Add a new CIDR to an existing network')
[CompletionResult]::new('delete-cidr', 'delete-cidr', [CompletionResultType]::ParameterValue, 'Delete a CIDR') [CompletionResult]::new('delete-cidr', 'delete-cidr', [CompletionResultType]::ParameterValue, 'Delete a CIDR')
[CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generate shell completion scripts') [CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generate shell completion scripts')
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Prints this message or the help of the given subcommand(s)') [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')
break break
} }
'innernet-server;new' { 'innernet-server;new' {
@ -48,27 +48,21 @@ Register-ArgumentCompleter -Native -CommandName 'innernet-server' -ScriptBlock {
[CompletionResult]::new('--external-endpoint', 'external-endpoint', [CompletionResultType]::ParameterName, 'This server''s external endpoint (ex: 100.100.100.100:51820)') [CompletionResult]::new('--external-endpoint', 'external-endpoint', [CompletionResultType]::ParameterName, 'This server''s external endpoint (ex: 100.100.100.100:51820)')
[CompletionResult]::new('--listen-port', 'listen-port', [CompletionResultType]::ParameterName, 'Port to listen on (for the WireGuard interface)') [CompletionResult]::new('--listen-port', 'listen-port', [CompletionResultType]::ParameterName, 'Port to listen on (for the WireGuard interface)')
[CompletionResult]::new('--auto-external-endpoint', 'auto-external-endpoint', [CompletionResultType]::ParameterName, 'Auto-resolve external endpoint') [CompletionResult]::new('--auto-external-endpoint', 'auto-external-endpoint', [CompletionResultType]::ParameterName, 'Auto-resolve external endpoint')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet-server;uninstall' { 'innernet-server;uninstall' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet-server;serve' { 'innernet-server;serve' {
[CompletionResult]::new('--backend', 'backend', [CompletionResultType]::ParameterName, 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability') [CompletionResult]::new('--backend', 'backend', [CompletionResultType]::ParameterName, 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability')
[CompletionResult]::new('--mtu', 'mtu', [CompletionResultType]::ParameterName, 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)') [CompletionResult]::new('--mtu', 'mtu', [CompletionResultType]::ParameterName, 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)')
[CompletionResult]::new('--no-routing', 'no-routing', [CompletionResultType]::ParameterName, 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld') [CompletionResult]::new('--no-routing', 'no-routing', [CompletionResultType]::ParameterName, 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet-server;add-peer' { 'innernet-server;add-peer' {
@ -80,20 +74,16 @@ Register-ArgumentCompleter -Native -CommandName 'innernet-server' -ScriptBlock {
[CompletionResult]::new('--invite-expires', 'invite-expires', [CompletionResultType]::ParameterName, 'Invite expiration period (eg. ''30d'', ''7w'', ''2h'', ''60m'', ''1000s'')') [CompletionResult]::new('--invite-expires', 'invite-expires', [CompletionResultType]::ParameterName, 'Invite expiration period (eg. ''30d'', ''7w'', ''2h'', ''60m'', ''1000s'')')
[CompletionResult]::new('--auto-ip', 'auto-ip', [CompletionResultType]::ParameterName, 'Auto-assign the peer the first available IP within the CIDR') [CompletionResult]::new('--auto-ip', 'auto-ip', [CompletionResultType]::ParameterName, 'Auto-assign the peer the first available IP within the CIDR')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation') [CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet-server;rename-peer' { 'innernet-server;rename-peer' {
[CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'Name of peer to rename') [CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'Name of peer to rename')
[CompletionResult]::new('--new-name', 'new-name', [CompletionResultType]::ParameterName, 'The new name of the peer') [CompletionResult]::new('--new-name', 'new-name', [CompletionResultType]::ParameterName, 'The new name of the peer')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation') [CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet-server;add-cidr' { 'innernet-server;add-cidr' {
@ -101,33 +91,23 @@ Register-ArgumentCompleter -Native -CommandName 'innernet-server' -ScriptBlock {
[CompletionResult]::new('--cidr', 'cidr', [CompletionResultType]::ParameterName, 'The CIDR network (eg. ''10.42.5.0/24'')') [CompletionResult]::new('--cidr', 'cidr', [CompletionResultType]::ParameterName, 'The CIDR network (eg. ''10.42.5.0/24'')')
[CompletionResult]::new('--parent', 'parent', [CompletionResultType]::ParameterName, 'The CIDR parent name') [CompletionResult]::new('--parent', 'parent', [CompletionResultType]::ParameterName, 'The CIDR parent name')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation') [CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet-server;delete-cidr' { 'innernet-server;delete-cidr' {
[CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'The CIDR name (eg. ''engineers'')') [CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'The CIDR name (eg. ''engineers'')')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation') [CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet-server;completions' { 'innernet-server;completions' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet-server;help' { 'innernet-server;help' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
}) })

View File

@ -15,17 +15,17 @@ _innernet-server() {
local context curcontext="$curcontext" state line local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-c+[]' \ '-c+[]:CONFIG_DIR: ' \
'--config-dir=[]' \ '--config-dir=[]:CONFIG_DIR: ' \
'-d+[]' \ '-d+[]:DATA_DIR: ' \
'--data-dir=[]' \ '--data-dir=[]:DATA_DIR: ' \
'--backend=[Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability]: :(kernel userspace)' \ '--backend=[Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability]:BACKEND:(kernel userspace)' \
'--mtu=[Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)]' \ '--mtu=[Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)]:MTU: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'--no-routing[Whether the routing should be done by innernet or is done by an external tool like e.g. babeld]' \ '--no-routing[Whether the routing should be done by innernet or is done by an external tool like e.g. babeld]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
":: :_innernet-server_commands" \ ":: :_innernet-server_commands" \
"*::: :->innernet-server" \ "*::: :->innernet-server" \
&& ret=0 && ret=0
@ -35,121 +35,88 @@ _innernet-server() {
(( CURRENT += 1 )) (( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:innernet-server-command-$line[1]:" curcontext="${curcontext%:*:*}:innernet-server-command-$line[1]:"
case $line[1] in case $line[1] in
(init) (new)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--network-name=[The network name (ex: evilcorp)]' \ '--network-name=[The network name (ex: evilcorp)]:NETWORK_NAME: ' \
'--network-cidr=[The network CIDR (ex: 10.42.0.0/16)]' \ '--network-cidr=[The network CIDR (ex: 10.42.0.0/16)]:NETWORK_CIDR: ' \
'(--auto-external-endpoint)--external-endpoint=[This server'\''s external endpoint (ex: 100.100.100.100:51820)]' \ '(--auto-external-endpoint)--external-endpoint=[This server'\''s external endpoint (ex: 100.100.100.100:51820)]:EXTERNAL_ENDPOINT: ' \
'--listen-port=[Port to listen on (for the WireGuard interface)]' \ '--listen-port=[Port to listen on (for the WireGuard interface)]:LISTEN_PORT: ' \
'--auto-external-endpoint[Auto-resolve external endpoint]' \ '--auto-external-endpoint[Auto-resolve external endpoint]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0
;;
(new)
_arguments "${_arguments_options[@]}" \
'--network-name=[The network name (ex: evilcorp)]' \
'--network-cidr=[The network CIDR (ex: 10.42.0.0/16)]' \
'(--auto-external-endpoint)--external-endpoint=[This server'\''s external endpoint (ex: 100.100.100.100:51820)]' \
'--listen-port=[Port to listen on (for the WireGuard interface)]' \
'--auto-external-endpoint[Auto-resolve external endpoint]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0 && ret=0
;; ;;
(uninstall) (uninstall)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(serve) (serve)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--backend=[Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability]: :(kernel userspace)' \ '--backend=[Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability]:BACKEND:(kernel userspace)' \
'--mtu=[Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)]' \ '--mtu=[Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)]:MTU: ' \
'--no-routing[Whether the routing should be done by innernet or is done by an external tool like e.g. babeld]' \ '--no-routing[Whether the routing should be done by innernet or is done by an external tool like e.g. babeld]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(add-peer) (add-peer)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--name=[Name of new peer]' \ '--name=[Name of new peer]:NAME: ' \
'(--auto-ip)--ip=[Specify desired IP of new peer (within parent CIDR)]' \ '(--auto-ip)--ip=[Specify desired IP of new peer (within parent CIDR)]:IP: ' \
'--cidr=[Name of CIDR to add new peer under]' \ '--cidr=[Name of CIDR to add new peer under]:CIDR: ' \
'--admin=[Make new peer an admin?]' \ '--admin=[Make new peer an admin?]:ADMIN: ' \
'--save-config=[Save the config to the given location]' \ '--save-config=[Save the config to the given location]:SAVE_CONFIG: ' \
'--invite-expires=[Invite expiration period (eg. '\''30d'\'', '\''7w'\'', '\''2h'\'', '\''60m'\'', '\''1000s'\'')]' \ '--invite-expires=[Invite expiration period (eg. '\''30d'\'', '\''7w'\'', '\''2h'\'', '\''60m'\'', '\''1000s'\'')]:INVITE_EXPIRES: ' \
'--auto-ip[Auto-assign the peer the first available IP within the CIDR]' \ '--auto-ip[Auto-assign the peer the first available IP within the CIDR]' \
'--yes[Bypass confirmation]' \ '--yes[Bypass confirmation]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(rename-peer) (rename-peer)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--name=[Name of peer to rename]' \ '--name=[Name of peer to rename]:NAME: ' \
'--new-name=[The new name of the peer]' \ '--new-name=[The new name of the peer]:NEW_NAME: ' \
'--yes[Bypass confirmation]' \ '--yes[Bypass confirmation]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(add-cidr) (add-cidr)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--name=[The CIDR name (eg. '\''engineers'\'')]' \ '--name=[The CIDR name (eg. '\''engineers'\'')]:NAME: ' \
'--cidr=[The CIDR network (eg. '\''10.42.5.0/24'\'')]' \ '--cidr=[The CIDR network (eg. '\''10.42.5.0/24'\'')]:CIDR: ' \
'--parent=[The CIDR parent name]' \ '--parent=[The CIDR parent name]:PARENT: ' \
'--yes[Bypass confirmation]' \ '--yes[Bypass confirmation]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(delete-cidr) (delete-cidr)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--name=[The CIDR name (eg. '\''engineers'\'')]' \ '--name=[The CIDR name (eg. '\''engineers'\'')]:NAME: ' \
'--yes[Bypass confirmation]' \ '--yes[Bypass confirmation]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(completions) (completions)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':shell:(bash elvish fish powershell zsh)' \
'--version[Prints version information]' \
':shell:(zsh bash fish powershell elvish)' \
&& ret=0 && ret=0
;; ;;
(help) (help)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0 && ret=0
;; ;;
esac esac
@ -160,93 +127,61 @@ esac
(( $+functions[_innernet-server_commands] )) || (( $+functions[_innernet-server_commands] )) ||
_innernet-server_commands() { _innernet-server_commands() {
local commands; commands=( local commands; commands=(
"new:Create a new network" \ 'new:Create a new network' \
"uninstall:Permanently uninstall a created network, rendering it unusable. Use with care" \ 'uninstall:Permanently uninstall a created network, rendering it unusable. Use with care' \
"serve:Serve the coordinating server for an existing network" \ 'serve:Serve the coordinating server for an existing network' \
"add-peer:Add a peer to an existing network" \ 'add-peer:Add a peer to an existing network' \
"rename-peer:Rename an existing peer" \ 'rename-peer:Rename an existing peer' \
"add-cidr:Add a new CIDR to an existing network" \ 'add-cidr:Add a new CIDR to an existing network' \
"delete-cidr:Delete a CIDR" \ 'delete-cidr:Delete a CIDR' \
"completions:Generate shell completion scripts" \ 'completions:Generate shell completion scripts' \
"help:Prints this message or the help of the given subcommand(s)" \ 'help:Print this message or the help of the given subcommand(s)' \
) )
_describe -t commands 'innernet-server commands' commands "$@" _describe -t commands 'innernet-server commands' commands "$@"
} }
(( $+functions[_innernet-server__add-cidr_commands] )) || (( $+functions[_innernet-server__add-cidr_commands] )) ||
_innernet-server__add-cidr_commands() { _innernet-server__add-cidr_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet-server add-cidr commands' commands "$@" _describe -t commands 'innernet-server add-cidr commands' commands "$@"
} }
(( $+functions[_innernet-server__add-peer_commands] )) || (( $+functions[_innernet-server__add-peer_commands] )) ||
_innernet-server__add-peer_commands() { _innernet-server__add-peer_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet-server add-peer commands' commands "$@" _describe -t commands 'innernet-server add-peer commands' commands "$@"
} }
(( $+functions[_innernet-server__completions_commands] )) || (( $+functions[_innernet-server__completions_commands] )) ||
_innernet-server__completions_commands() { _innernet-server__completions_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet-server completions commands' commands "$@" _describe -t commands 'innernet-server completions commands' commands "$@"
} }
(( $+functions[_innernet-server__delete-cidr_commands] )) || (( $+functions[_innernet-server__delete-cidr_commands] )) ||
_innernet-server__delete-cidr_commands() { _innernet-server__delete-cidr_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet-server delete-cidr commands' commands "$@" _describe -t commands 'innernet-server delete-cidr commands' commands "$@"
} }
(( $+functions[_innernet-server__help_commands] )) || (( $+functions[_innernet-server__help_commands] )) ||
_innernet-server__help_commands() { _innernet-server__help_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet-server help commands' commands "$@" _describe -t commands 'innernet-server help commands' commands "$@"
} }
(( $+functions[_init_commands] )) ||
_init_commands() {
local commands; commands=(
)
_describe -t commands 'init commands' commands "$@"
}
(( $+functions[_innernet-server__init_commands] )) ||
_innernet-server__init_commands() {
local commands; commands=(
)
_describe -t commands 'innernet-server init commands' commands "$@"
}
(( $+functions[_innernet-server__new_commands] )) || (( $+functions[_innernet-server__new_commands] )) ||
_innernet-server__new_commands() { _innernet-server__new_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet-server new commands' commands "$@" _describe -t commands 'innernet-server new commands' commands "$@"
} }
(( $+functions[_innernet-server__rename-peer_commands] )) || (( $+functions[_innernet-server__rename-peer_commands] )) ||
_innernet-server__rename-peer_commands() { _innernet-server__rename-peer_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet-server rename-peer commands' commands "$@" _describe -t commands 'innernet-server rename-peer commands' commands "$@"
} }
(( $+functions[_innernet-server__serve_commands] )) || (( $+functions[_innernet-server__serve_commands] )) ||
_innernet-server__serve_commands() { _innernet-server__serve_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet-server serve commands' commands "$@" _describe -t commands 'innernet-server serve commands' commands "$@"
} }
(( $+functions[_innernet-server__uninstall_commands] )) || (( $+functions[_innernet-server__uninstall_commands] )) ||
_innernet-server__uninstall_commands() { _innernet-server__uninstall_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet-server uninstall commands' commands "$@" _describe -t commands 'innernet-server uninstall commands' commands "$@"
} }

View File

@ -1,47 +1,43 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
.TH INNERNET "8" "December 2021" "innernet 1.5.2" "System Administration Utilities" .TH INNERNET "8" "January 2022" "innernet 1.5.3-beta.1" "System Administration Utilities"
.SH NAME .SH NAME
innernet \- manual page for innernet 1.5.2 innernet \- manual page for innernet 1.5.3-beta.1
.SH DESCRIPTION .SH DESCRIPTION
innernet 1.5.2 innernet 1.5.3\-beta.1
Jake McGinty <jake@tonari.no>
A client to manage innernet network interfaces. A client to manage innernet network interfaces.
.SS "USAGE:" .SS "USAGE:"
.IP .IP
innernet [OPTIONS] [SUBCOMMAND] innernet [OPTIONS] [SUBCOMMAND]
.SS "OPTIONS:" .SS "OPTIONS:"
.HP .TP
\fB\-v\fR, \fB\-\-verbose\fR \fB\-v\fR, \fB\-\-verbose\fR
.IP
Verbose output, use \fB\-vv\fR for even higher verbositude Verbose output, use \fB\-vv\fR for even higher verbositude
.HP .TP
\fB\-c\fR, \fB\-\-config\-dir\fR <config\-dir> \fB\-c\fR, \fB\-\-config\-dir\fR <CONFIG_DIR>
.IP
[default: /etc/innernet] [default: /etc/innernet]
.HP .TP
\fB\-d\fR, \fB\-\-data\-dir\fR <data\-dir> \fB\-d\fR, \fB\-\-data\-dir\fR <DATA_DIR>
.IP
[default: /var/lib/innernet] [default: /var/lib/innernet]
.HP .TP
\fB\-\-no\-routing\fR \fB\-\-no\-routing\fR
.IP Whether the routing should be done by innernet or is done by an
Whether the routing should be done by innernet or is done by an external tool like e.g. babeld external tool like e.g. babeld
.HP .TP
\fB\-\-backend\fR <backend> \fB\-\-backend\fR <BACKEND>
.IP Specify a WireGuard backend to use. If not set, innernet will
Specify a WireGuard backend to use. If not set, innernet will auto\-select based on availability [default: auto\-select based on availability [default: kernel] [possible
kernel] [possible values: kernel, userspace] values: kernel, userspace]
.HP .TP
\fB\-\-mtu\fR <mtu> \fB\-\-mtu\fR <MTU>
.IP Specify the desired MTU for your interface (default: 1420 for
Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6) IPv4 and 1400 for IPv6)
.HP .TP
\fB\-h\fR, \fB\-\-help\fR \fB\-h\fR, \fB\-\-help\fR
.IP Print help information
Prints help information .TP
.HP
\fB\-V\fR, \fB\-\-version\fR \fB\-V\fR, \fB\-\-version\fR
.IP Print version information
Prints version information
.SS "SUBCOMMANDS:" .SS "SUBCOMMANDS:"
.TP .TP
install install
@ -102,4 +98,4 @@ completions
Generate shell completion scripts Generate shell completion scripts
.TP .TP
help help
Prints this message or the help of the given subcommand(s) Print this message or the help of the given subcommand(s)

Binary file not shown.

View File

@ -9,10 +9,9 @@ _innernet() {
for i in ${COMP_WORDS[@]} for i in ${COMP_WORDS[@]}
do do
case "${i}" in case "${i}" in
innernet) "$1")
cmd="innernet" cmd="innernet"
;; ;;
add-association) add-association)
cmd+="__add__association" cmd+="__add__association"
;; ;;
@ -49,9 +48,6 @@ _innernet() {
install) install)
cmd+="__install" cmd+="__install"
;; ;;
list)
cmd+="__list"
;;
list-associations) list-associations)
cmd+="__list__associations" cmd+="__list__associations"
;; ;;
@ -61,9 +57,6 @@ _innernet() {
override-endpoint) override-endpoint)
cmd+="__override__endpoint" cmd+="__override__endpoint"
;; ;;
redeem)
cmd+="__redeem"
;;
rename-peer) rename-peer)
cmd+="__rename__peer" cmd+="__rename__peer"
;; ;;
@ -86,18 +79,17 @@ _innernet() {
case "${cmd}" in case "${cmd}" in
innernet) innernet)
opts=" -v -h -V -c -d --verbose --no-routing --help --version --config-dir --data-dir --backend --mtu install show up fetch uninstall down add-peer rename-peer add-cidr delete-cidr list-cidrs disable-peer enable-peer add-association delete-association list-associations set-listen-port override-endpoint completions help redeem list" opts="-h -V -v -c -d --help --version --verbose --config-dir --data-dir --no-routing --backend --mtu install show up fetch uninstall down add-peer rename-peer add-cidr delete-cidr list-cidrs disable-peer enable-peer add-association delete-association list-associations set-listen-port override-endpoint completions help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--config-dir) --config-dir)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
;; ;;
-c) -c)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
;; ;;
@ -105,7 +97,7 @@ _innernet() {
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
;; ;;
-d) -d)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
;; ;;
@ -124,15 +116,13 @@ _innernet() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
;; ;;
innernet__add__association) innernet__add__association)
opts=" -h -V --help --version <interface> <cidr1> <cidr2> " opts="-h --help <INTERFACE> <CIDR1> <CIDR2>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;
@ -141,13 +131,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__add__cidr) innernet__add__cidr)
opts=" -h -V --yes --help --version --name --cidr --parent <interface> " opts="-h --name --cidr --parent --yes --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--name) --name)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
@ -168,13 +157,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__add__peer) innernet__add__peer)
opts=" -h -V --auto-ip --yes --help --version --name --ip --cidr --admin --save-config --invite-expires <interface> " opts="-h --name --ip --auto-ip --cidr --admin --yes --save-config --invite-expires --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--name) --name)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
@ -207,13 +195,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__completions) innernet__completions)
opts=" -h -V --help --version <shell> " opts="-h --help bash elvish fish powershell zsh"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;
@ -222,13 +209,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__delete__association) innernet__delete__association)
opts=" -h -V --help --version <interface> " opts="-h --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;
@ -237,13 +223,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__delete__cidr) innernet__delete__cidr)
opts=" -h -V --yes --help --version --name <interface> " opts="-h --name --yes --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--name) --name)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
@ -256,13 +241,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__disable__peer) innernet__disable__peer)
opts=" -h -V --help --version <interface> " opts="-h --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;
@ -271,13 +255,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__down) innernet__down)
opts=" -h -V --help --version <interface> " opts="-h --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;
@ -286,13 +269,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__enable__peer) innernet__enable__peer)
opts=" -h -V --help --version <interface> " opts="-h --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;
@ -301,13 +283,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__fetch) innernet__fetch)
opts=" -h -V --no-write-hosts --no-nat-traversal --no-nat-candidates --help --version --hosts-path --exclude-nat-candidates <interface> " opts="-h --hosts-path --no-write-hosts --no-nat-traversal --exclude-nat-candidates --no-nat-candidates --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--hosts-path) --hosts-path)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
@ -324,13 +305,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__help) innernet__help)
opts=" -h -V --help --version " opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;
@ -339,13 +319,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__install) innernet__install)
opts=" -d -h -V --no-write-hosts --default-name --delete-invite --no-nat-traversal --no-nat-candidates --help --version --hosts-path --name --exclude-nat-candidates <invite> " opts="-d -h --hosts-path --no-write-hosts --name --default-name --delete-invite --no-nat-traversal --exclude-nat-candidates --no-nat-candidates --help <INVITE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--hosts-path) --hosts-path)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
@ -365,29 +344,13 @@ _innernet() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
;; ;;
innernet__list)
opts=" -s -t -h -V --short --tree --help --version <interface> "
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
innernet__list__associations) innernet__list__associations)
opts=" -h -V --help --version <interface> " opts="-h --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;
@ -396,13 +359,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__list__cidrs) innernet__list__cidrs)
opts=" -t -h -V --tree --help --version <interface> " opts="-t -h --tree --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;
@ -411,45 +373,17 @@ _innernet() {
return 0 return 0
;; ;;
innernet__override__endpoint) innernet__override__endpoint)
opts=" -u -h -V -e --unset --yes --help --version --endpoint <interface> " opts="-e -u -h --endpoint --unset --yes --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--endpoint) --endpoint)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
;; ;;
-e) -e)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
innernet__redeem)
opts=" -d -h -V --no-write-hosts --default-name --delete-invite --no-nat-traversal --no-nat-candidates --help --version --hosts-path --name --exclude-nat-candidates <invite> "
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--hosts-path)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--name)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
--exclude-nat-candidates)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
;; ;;
@ -461,13 +395,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__rename__peer) innernet__rename__peer)
opts=" -h -V --yes --help --version --name --new-name <interface> " opts="-h --name --new-name --yes --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--name) --name)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
@ -484,18 +417,17 @@ _innernet() {
return 0 return 0
;; ;;
innernet__set__listen__port) innernet__set__listen__port)
opts=" -u -h -V -l --unset --yes --help --version --listen-port <interface> " opts="-l -u -h --listen-port --unset --yes --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--listen-port) --listen-port)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
;; ;;
-l) -l)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0
;; ;;
@ -507,13 +439,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__show) innernet__show)
opts=" -s -t -h -V --short --tree --help --version <interface> " opts="-s -t -h --short --tree --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;
@ -522,13 +453,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__uninstall) innernet__uninstall)
opts=" -h -V --help --version <interface> " opts="-h --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
*) *)
COMPREPLY=() COMPREPLY=()
;; ;;
@ -537,13 +467,12 @@ _innernet() {
return 0 return 0
;; ;;
innernet__up) innernet__up)
opts=" -d -h -V --daemon --no-write-hosts --no-nat-traversal --no-nat-candidates --help --version --interval --hosts-path --exclude-nat-candidates <interface> " opts="-d -h --daemon --interval --hosts-path --no-write-hosts --no-nat-traversal --exclude-nat-candidates --no-nat-candidates --help <INTERFACE>"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0 return 0
fi fi
case "${prev}" in case "${prev}" in
--interval) --interval)
COMPREPLY=($(compgen -f "${cur}")) COMPREPLY=($(compgen -f "${cur}"))
return 0 return 0

View File

@ -1,19 +1,22 @@
edit:completion:arg-completer[innernet] = [@words]{ use builtin;
use str;
set edit:completion:arg-completer[innernet] = [@words]{
fn spaces [n]{ fn spaces [n]{
repeat $n ' ' | joins '' builtin:repeat $n ' ' | str:join ''
} }
fn cand [text desc]{ fn cand [text desc]{
edit:complex-candidate $text &display-suffix=' '(spaces (- 14 (wcswidth $text)))$desc edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
} }
command = 'innernet' var command = 'innernet'
for word $words[1:-1] { for word $words[1..-1] {
if (has-prefix $word '-') { if (str:has-prefix $word '-') {
break break
} }
command = $command';'$word set command = $command';'$word
} }
completions = [ var completions = [
&'innernet'= { &'innernet'= {
cand -c 'c' cand -c 'c'
cand --config-dir 'config-dir' cand --config-dir 'config-dir'
@ -21,13 +24,13 @@ edit:completion:arg-completer[innernet] = [@words]{
cand --data-dir 'data-dir' cand --data-dir 'data-dir'
cand --backend 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability' cand --backend 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability'
cand --mtu 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)' cand --mtu 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)'
cand -h 'Print help information'
cand --help 'Print help information'
cand -V 'Print version information'
cand --version 'Print version information'
cand -v 'Verbose output, use -vv for even higher verbositude' cand -v 'Verbose output, use -vv for even higher verbositude'
cand --verbose 'Verbose output, use -vv for even higher verbositude' cand --verbose 'Verbose output, use -vv for even higher verbositude'
cand --no-routing 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld' cand --no-routing 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld'
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
cand install 'Install a new innernet config' cand install 'Install a new innernet config'
cand show 'Enumerate all innernet connections' cand show 'Enumerate all innernet connections'
cand up 'Bring up your local interface, and update it with latest peer list' cand up 'Bring up your local interface, and update it with latest peer list'
@ -47,7 +50,7 @@ edit:completion:arg-completer[innernet] = [@words]{
cand set-listen-port 'Set the local listen port' cand set-listen-port 'Set the local listen port'
cand override-endpoint 'Override your external endpoint that the server sends to other peers' cand override-endpoint 'Override your external endpoint that the server sends to other peers'
cand completions 'Generate shell completion scripts' cand completions 'Generate shell completion scripts'
cand help 'Prints this message or the help of the given subcommand(s)' cand help 'Print this message or the help of the given subcommand(s)'
} }
&'innernet;install'= { &'innernet;install'= {
cand --hosts-path 'The path to write hosts to' cand --hosts-path 'The path to write hosts to'
@ -59,20 +62,16 @@ edit:completion:arg-completer[innernet] = [@words]{
cand --delete-invite 'Delete the invitation after a successful install' cand --delete-invite 'Delete the invitation after a successful install'
cand --no-nat-traversal 'Don''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates' cand --no-nat-traversal 'Don''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates'
cand --no-nat-candidates 'Don''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates ''0.0.0.0/0''' cand --no-nat-candidates 'Don''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates ''0.0.0.0/0'''
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;show'= { &'innernet;show'= {
cand -s 'One-line peer list' cand -s 'One-line peer list'
cand --short 'One-line peer list' cand --short 'One-line peer list'
cand -t 'Display peers in a tree based on the CIDRs' cand -t 'Display peers in a tree based on the CIDRs'
cand --tree 'Display peers in a tree based on the CIDRs' cand --tree 'Display peers in a tree based on the CIDRs'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;up'= { &'innernet;up'= {
cand --interval 'Keep fetching the latest peer list at the specified interval in seconds. Valid only in daemon mode' cand --interval 'Keep fetching the latest peer list at the specified interval in seconds. Valid only in daemon mode'
@ -83,10 +82,8 @@ edit:completion:arg-completer[innernet] = [@words]{
cand --no-write-hosts 'Don''t write to any hosts files' cand --no-write-hosts 'Don''t write to any hosts files'
cand --no-nat-traversal 'Don''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates' cand --no-nat-traversal 'Don''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates'
cand --no-nat-candidates 'Don''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates ''0.0.0.0/0''' cand --no-nat-candidates 'Don''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates ''0.0.0.0/0'''
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;fetch'= { &'innernet;fetch'= {
cand --hosts-path 'The path to write hosts to' cand --hosts-path 'The path to write hosts to'
@ -94,22 +91,16 @@ edit:completion:arg-completer[innernet] = [@words]{
cand --no-write-hosts 'Don''t write to any hosts files' cand --no-write-hosts 'Don''t write to any hosts files'
cand --no-nat-traversal 'Don''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates' cand --no-nat-traversal 'Don''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates'
cand --no-nat-candidates 'Don''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates ''0.0.0.0/0''' cand --no-nat-candidates 'Don''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates ''0.0.0.0/0'''
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;uninstall'= { &'innernet;uninstall'= {
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;down'= { &'innernet;down'= {
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;add-peer'= { &'innernet;add-peer'= {
cand --name 'Name of new peer' cand --name 'Name of new peer'
@ -120,75 +111,55 @@ edit:completion:arg-completer[innernet] = [@words]{
cand --invite-expires 'Invite expiration period (eg. ''30d'', ''7w'', ''2h'', ''60m'', ''1000s'')' cand --invite-expires 'Invite expiration period (eg. ''30d'', ''7w'', ''2h'', ''60m'', ''1000s'')'
cand --auto-ip 'Auto-assign the peer the first available IP within the CIDR' cand --auto-ip 'Auto-assign the peer the first available IP within the CIDR'
cand --yes 'Bypass confirmation' cand --yes 'Bypass confirmation'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;rename-peer'= { &'innernet;rename-peer'= {
cand --name 'Name of peer to rename' cand --name 'Name of peer to rename'
cand --new-name 'The new name of the peer' cand --new-name 'The new name of the peer'
cand --yes 'Bypass confirmation' cand --yes 'Bypass confirmation'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;add-cidr'= { &'innernet;add-cidr'= {
cand --name 'The CIDR name (eg. ''engineers'')' cand --name 'The CIDR name (eg. ''engineers'')'
cand --cidr 'The CIDR network (eg. ''10.42.5.0/24'')' cand --cidr 'The CIDR network (eg. ''10.42.5.0/24'')'
cand --parent 'The CIDR parent name' cand --parent 'The CIDR parent name'
cand --yes 'Bypass confirmation' cand --yes 'Bypass confirmation'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;delete-cidr'= { &'innernet;delete-cidr'= {
cand --name 'The CIDR name (eg. ''engineers'')' cand --name 'The CIDR name (eg. ''engineers'')'
cand --yes 'Bypass confirmation' cand --yes 'Bypass confirmation'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;list-cidrs'= { &'innernet;list-cidrs'= {
cand -t 'Display CIDRs in tree format' cand -t 'Display CIDRs in tree format'
cand --tree 'Display CIDRs in tree format' cand --tree 'Display CIDRs in tree format'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;disable-peer'= { &'innernet;disable-peer'= {
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;enable-peer'= { &'innernet;enable-peer'= {
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;add-association'= { &'innernet;add-association'= {
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;delete-association'= { &'innernet;delete-association'= {
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;list-associations'= { &'innernet;list-associations'= {
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;set-listen-port'= { &'innernet;set-listen-port'= {
cand -l 'The listen port you''d like to set for the interface' cand -l 'The listen port you''d like to set for the interface'
@ -196,10 +167,8 @@ edit:completion:arg-completer[innernet] = [@words]{
cand -u 'Unset the local listen port to use a randomized port' cand -u 'Unset the local listen port to use a randomized port'
cand --unset 'Unset the local listen port to use a randomized port' cand --unset 'Unset the local listen port to use a randomized port'
cand --yes 'Bypass confirmation' cand --yes 'Bypass confirmation'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;override-endpoint'= { &'innernet;override-endpoint'= {
cand -e 'The listen port you''d like to set for the interface' cand -e 'The listen port you''d like to set for the interface'
@ -207,22 +176,14 @@ edit:completion:arg-completer[innernet] = [@words]{
cand -u 'Unset an existing override to use the automatic endpoint discovery' cand -u 'Unset an existing override to use the automatic endpoint discovery'
cand --unset 'Unset an existing override to use the automatic endpoint discovery' cand --unset 'Unset an existing override to use the automatic endpoint discovery'
cand --yes 'Bypass confirmation' cand --yes 'Bypass confirmation'
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;completions'= { &'innernet;completions'= {
cand -h 'Prints help information' cand -h 'Print help information'
cand --help 'Prints help information' cand --help 'Print help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
&'innernet;help'= { &'innernet;help'= {
cand -h 'Prints help information'
cand --help 'Prints help information'
cand -V 'Prints version information'
cand --version 'Prints version information'
} }
] ]
$completions[$command] $completions[$command]

View File

@ -1,11 +1,11 @@
complete -c innernet -n "__fish_use_subcommand" -s c -l config-dir complete -c innernet -n "__fish_use_subcommand" -s c -l config-dir -r
complete -c innernet -n "__fish_use_subcommand" -s d -l data-dir complete -c innernet -n "__fish_use_subcommand" -s d -l data-dir -r
complete -c innernet -n "__fish_use_subcommand" -l backend -d 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability' -r -f -a "kernel userspace" complete -c innernet -n "__fish_use_subcommand" -l backend -d 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability' -r -f -a "{kernel ,userspace }"
complete -c innernet -n "__fish_use_subcommand" -l mtu -d 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)' complete -c innernet -n "__fish_use_subcommand" -l mtu -d 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)' -r
complete -c innernet -n "__fish_use_subcommand" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_use_subcommand" -s V -l version -d 'Print version information'
complete -c innernet -n "__fish_use_subcommand" -s v -l verbose -d 'Verbose output, use -vv for even higher verbositude' complete -c innernet -n "__fish_use_subcommand" -s v -l verbose -d 'Verbose output, use -vv for even higher verbositude'
complete -c innernet -n "__fish_use_subcommand" -l no-routing -d 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld' complete -c innernet -n "__fish_use_subcommand" -l no-routing -d 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld'
complete -c innernet -n "__fish_use_subcommand" -s h -l help -d 'Prints help information'
complete -c innernet -n "__fish_use_subcommand" -s V -l version -d 'Prints version information'
complete -c innernet -n "__fish_use_subcommand" -f -a "install" -d 'Install a new innernet config' complete -c innernet -n "__fish_use_subcommand" -f -a "install" -d 'Install a new innernet config'
complete -c innernet -n "__fish_use_subcommand" -f -a "show" -d 'Enumerate all innernet connections' complete -c innernet -n "__fish_use_subcommand" -f -a "show" -d 'Enumerate all innernet connections'
complete -c innernet -n "__fish_use_subcommand" -f -a "up" -d 'Bring up your local interface, and update it with latest peer list' complete -c innernet -n "__fish_use_subcommand" -f -a "up" -d 'Bring up your local interface, and update it with latest peer list'
@ -25,90 +25,69 @@ complete -c innernet -n "__fish_use_subcommand" -f -a "list-associations" -d 'Li
complete -c innernet -n "__fish_use_subcommand" -f -a "set-listen-port" -d 'Set the local listen port' complete -c innernet -n "__fish_use_subcommand" -f -a "set-listen-port" -d 'Set the local listen port'
complete -c innernet -n "__fish_use_subcommand" -f -a "override-endpoint" -d 'Override your external endpoint that the server sends to other peers' complete -c innernet -n "__fish_use_subcommand" -f -a "override-endpoint" -d 'Override your external endpoint that the server sends to other peers'
complete -c innernet -n "__fish_use_subcommand" -f -a "completions" -d 'Generate shell completion scripts' complete -c innernet -n "__fish_use_subcommand" -f -a "completions" -d 'Generate shell completion scripts'
complete -c innernet -n "__fish_use_subcommand" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)' complete -c innernet -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c innernet -n "__fish_seen_subcommand_from install" -l hosts-path -d 'The path to write hosts to' complete -c innernet -n "__fish_seen_subcommand_from install" -l hosts-path -d 'The path to write hosts to' -r
complete -c innernet -n "__fish_seen_subcommand_from install" -l name -d 'Set a specific interface name' complete -c innernet -n "__fish_seen_subcommand_from install" -l name -d 'Set a specific interface name' -r
complete -c innernet -n "__fish_seen_subcommand_from install" -l exclude-nat-candidates -d 'Exclude one or more CIDRs from NAT candidate reporting. ex. --exclude-nat-candidates \'0.0.0.0/0\' would report no candidates' complete -c innernet -n "__fish_seen_subcommand_from install" -l exclude-nat-candidates -d 'Exclude one or more CIDRs from NAT candidate reporting. ex. --exclude-nat-candidates \'0.0.0.0/0\' would report no candidates' -r
complete -c innernet -n "__fish_seen_subcommand_from install" -l no-write-hosts -d 'Don\'t write to any hosts files' complete -c innernet -n "__fish_seen_subcommand_from install" -l no-write-hosts -d 'Don\'t write to any hosts files'
complete -c innernet -n "__fish_seen_subcommand_from install" -l default-name -d 'Use the network name inside the invitation as the interface name' complete -c innernet -n "__fish_seen_subcommand_from install" -l default-name -d 'Use the network name inside the invitation as the interface name'
complete -c innernet -n "__fish_seen_subcommand_from install" -s d -l delete-invite -d 'Delete the invitation after a successful install' complete -c innernet -n "__fish_seen_subcommand_from install" -s d -l delete-invite -d 'Delete the invitation after a successful install'
complete -c innernet -n "__fish_seen_subcommand_from install" -l no-nat-traversal -d 'Don\'t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates' complete -c innernet -n "__fish_seen_subcommand_from install" -l no-nat-traversal -d 'Don\'t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates'
complete -c innernet -n "__fish_seen_subcommand_from install" -l no-nat-candidates -d 'Don\'t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates \'0.0.0.0/0\'' complete -c innernet -n "__fish_seen_subcommand_from install" -l no-nat-candidates -d 'Don\'t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates \'0.0.0.0/0\''
complete -c innernet -n "__fish_seen_subcommand_from install" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from install" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from install" -s V -l version -d 'Prints version information'
complete -c innernet -n "__fish_seen_subcommand_from show" -s s -l short -d 'One-line peer list' complete -c innernet -n "__fish_seen_subcommand_from show" -s s -l short -d 'One-line peer list'
complete -c innernet -n "__fish_seen_subcommand_from show" -s t -l tree -d 'Display peers in a tree based on the CIDRs' complete -c innernet -n "__fish_seen_subcommand_from show" -s t -l tree -d 'Display peers in a tree based on the CIDRs'
complete -c innernet -n "__fish_seen_subcommand_from show" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from show" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from show" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from up" -l interval -d 'Keep fetching the latest peer list at the specified interval in seconds. Valid only in daemon mode' -r
complete -c innernet -n "__fish_seen_subcommand_from up" -l interval -d 'Keep fetching the latest peer list at the specified interval in seconds. Valid only in daemon mode' complete -c innernet -n "__fish_seen_subcommand_from up" -l hosts-path -d 'The path to write hosts to' -r
complete -c innernet -n "__fish_seen_subcommand_from up" -l hosts-path -d 'The path to write hosts to' complete -c innernet -n "__fish_seen_subcommand_from up" -l exclude-nat-candidates -d 'Exclude one or more CIDRs from NAT candidate reporting. ex. --exclude-nat-candidates \'0.0.0.0/0\' would report no candidates' -r
complete -c innernet -n "__fish_seen_subcommand_from up" -l exclude-nat-candidates -d 'Exclude one or more CIDRs from NAT candidate reporting. ex. --exclude-nat-candidates \'0.0.0.0/0\' would report no candidates'
complete -c innernet -n "__fish_seen_subcommand_from up" -s d -l daemon -d 'Enable daemon mode i.e. keep the process running, while fetching the latest peer list periodically' complete -c innernet -n "__fish_seen_subcommand_from up" -s d -l daemon -d 'Enable daemon mode i.e. keep the process running, while fetching the latest peer list periodically'
complete -c innernet -n "__fish_seen_subcommand_from up" -l no-write-hosts -d 'Don\'t write to any hosts files' complete -c innernet -n "__fish_seen_subcommand_from up" -l no-write-hosts -d 'Don\'t write to any hosts files'
complete -c innernet -n "__fish_seen_subcommand_from up" -l no-nat-traversal -d 'Don\'t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates' complete -c innernet -n "__fish_seen_subcommand_from up" -l no-nat-traversal -d 'Don\'t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates'
complete -c innernet -n "__fish_seen_subcommand_from up" -l no-nat-candidates -d 'Don\'t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates \'0.0.0.0/0\'' complete -c innernet -n "__fish_seen_subcommand_from up" -l no-nat-candidates -d 'Don\'t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates \'0.0.0.0/0\''
complete -c innernet -n "__fish_seen_subcommand_from up" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from up" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from up" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from fetch" -l hosts-path -d 'The path to write hosts to' -r
complete -c innernet -n "__fish_seen_subcommand_from fetch" -l hosts-path -d 'The path to write hosts to' complete -c innernet -n "__fish_seen_subcommand_from fetch" -l exclude-nat-candidates -d 'Exclude one or more CIDRs from NAT candidate reporting. ex. --exclude-nat-candidates \'0.0.0.0/0\' would report no candidates' -r
complete -c innernet -n "__fish_seen_subcommand_from fetch" -l exclude-nat-candidates -d 'Exclude one or more CIDRs from NAT candidate reporting. ex. --exclude-nat-candidates \'0.0.0.0/0\' would report no candidates'
complete -c innernet -n "__fish_seen_subcommand_from fetch" -l no-write-hosts -d 'Don\'t write to any hosts files' complete -c innernet -n "__fish_seen_subcommand_from fetch" -l no-write-hosts -d 'Don\'t write to any hosts files'
complete -c innernet -n "__fish_seen_subcommand_from fetch" -l no-nat-traversal -d 'Don\'t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates' complete -c innernet -n "__fish_seen_subcommand_from fetch" -l no-nat-traversal -d 'Don\'t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates'
complete -c innernet -n "__fish_seen_subcommand_from fetch" -l no-nat-candidates -d 'Don\'t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates \'0.0.0.0/0\'' complete -c innernet -n "__fish_seen_subcommand_from fetch" -l no-nat-candidates -d 'Don\'t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates \'0.0.0.0/0\''
complete -c innernet -n "__fish_seen_subcommand_from fetch" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from fetch" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from fetch" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from uninstall" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from uninstall" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from down" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from uninstall" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l name -d 'Name of new peer' -r
complete -c innernet -n "__fish_seen_subcommand_from down" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l ip -d 'Specify desired IP of new peer (within parent CIDR)' -r
complete -c innernet -n "__fish_seen_subcommand_from down" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l cidr -d 'Name of CIDR to add new peer under' -r
complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l name -d 'Name of new peer' complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l admin -d 'Make new peer an admin?' -r
complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l ip -d 'Specify desired IP of new peer (within parent CIDR)' complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l save-config -d 'Save the config to the given location' -r
complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l cidr -d 'Name of CIDR to add new peer under' complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l invite-expires -d 'Invite expiration period (eg. \'30d\', \'7w\', \'2h\', \'60m\', \'1000s\')' -r
complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l admin -d 'Make new peer an admin?'
complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l save-config -d 'Save the config to the given location'
complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l invite-expires -d 'Invite expiration period (eg. \'30d\', \'7w\', \'2h\', \'60m\', \'1000s\')'
complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l auto-ip -d 'Auto-assign the peer the first available IP within the CIDR' complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l auto-ip -d 'Auto-assign the peer the first available IP within the CIDR'
complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l yes -d 'Bypass confirmation' complete -c innernet -n "__fish_seen_subcommand_from add-peer" -l yes -d 'Bypass confirmation'
complete -c innernet -n "__fish_seen_subcommand_from add-peer" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from add-peer" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from add-peer" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -l name -d 'Name of peer to rename' -r
complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -l name -d 'Name of peer to rename' complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -l new-name -d 'The new name of the peer' -r
complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -l new-name -d 'The new name of the peer'
complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -l yes -d 'Bypass confirmation' complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -l yes -d 'Bypass confirmation'
complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from rename-peer" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l name -d 'The CIDR name (eg. \'engineers\')' -r
complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l name -d 'The CIDR name (eg. \'engineers\')' complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l cidr -d 'The CIDR network (eg. \'10.42.5.0/24\')' -r
complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l cidr -d 'The CIDR network (eg. \'10.42.5.0/24\')' complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l parent -d 'The CIDR parent name' -r
complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l parent -d 'The CIDR parent name'
complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l yes -d 'Bypass confirmation' complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -l yes -d 'Bypass confirmation'
complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from add-cidr" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from delete-cidr" -l name -d 'The CIDR name (eg. \'engineers\')' -r
complete -c innernet -n "__fish_seen_subcommand_from delete-cidr" -l name -d 'The CIDR name (eg. \'engineers\')'
complete -c innernet -n "__fish_seen_subcommand_from delete-cidr" -l yes -d 'Bypass confirmation' complete -c innernet -n "__fish_seen_subcommand_from delete-cidr" -l yes -d 'Bypass confirmation'
complete -c innernet -n "__fish_seen_subcommand_from delete-cidr" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from delete-cidr" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from delete-cidr" -s V -l version -d 'Prints version information'
complete -c innernet -n "__fish_seen_subcommand_from list-cidrs" -s t -l tree -d 'Display CIDRs in tree format' complete -c innernet -n "__fish_seen_subcommand_from list-cidrs" -s t -l tree -d 'Display CIDRs in tree format'
complete -c innernet -n "__fish_seen_subcommand_from list-cidrs" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from list-cidrs" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from list-cidrs" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from disable-peer" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from disable-peer" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from enable-peer" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from disable-peer" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from add-association" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from enable-peer" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from delete-association" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from enable-peer" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from list-associations" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from add-association" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from set-listen-port" -s l -l listen-port -d 'The listen port you\'d like to set for the interface' -r
complete -c innernet -n "__fish_seen_subcommand_from add-association" -s V -l version -d 'Prints version information'
complete -c innernet -n "__fish_seen_subcommand_from delete-association" -s h -l help -d 'Prints help information'
complete -c innernet -n "__fish_seen_subcommand_from delete-association" -s V -l version -d 'Prints version information'
complete -c innernet -n "__fish_seen_subcommand_from list-associations" -s h -l help -d 'Prints help information'
complete -c innernet -n "__fish_seen_subcommand_from list-associations" -s V -l version -d 'Prints version information'
complete -c innernet -n "__fish_seen_subcommand_from set-listen-port" -s l -l listen-port -d 'The listen port you\'d like to set for the interface'
complete -c innernet -n "__fish_seen_subcommand_from set-listen-port" -s u -l unset -d 'Unset the local listen port to use a randomized port' complete -c innernet -n "__fish_seen_subcommand_from set-listen-port" -s u -l unset -d 'Unset the local listen port to use a randomized port'
complete -c innernet -n "__fish_seen_subcommand_from set-listen-port" -l yes -d 'Bypass confirmation' complete -c innernet -n "__fish_seen_subcommand_from set-listen-port" -l yes -d 'Bypass confirmation'
complete -c innernet -n "__fish_seen_subcommand_from set-listen-port" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from set-listen-port" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from set-listen-port" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from override-endpoint" -s e -l endpoint -d 'The listen port you\'d like to set for the interface' -r
complete -c innernet -n "__fish_seen_subcommand_from override-endpoint" -s e -l endpoint -d 'The listen port you\'d like to set for the interface'
complete -c innernet -n "__fish_seen_subcommand_from override-endpoint" -s u -l unset -d 'Unset an existing override to use the automatic endpoint discovery' complete -c innernet -n "__fish_seen_subcommand_from override-endpoint" -s u -l unset -d 'Unset an existing override to use the automatic endpoint discovery'
complete -c innernet -n "__fish_seen_subcommand_from override-endpoint" -l yes -d 'Bypass confirmation' complete -c innernet -n "__fish_seen_subcommand_from override-endpoint" -l yes -d 'Bypass confirmation'
complete -c innernet -n "__fish_seen_subcommand_from override-endpoint" -s h -l help -d 'Prints help information' complete -c innernet -n "__fish_seen_subcommand_from override-endpoint" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from override-endpoint" -s V -l version -d 'Prints version information' complete -c innernet -n "__fish_seen_subcommand_from completions" -s h -l help -d 'Print help information'
complete -c innernet -n "__fish_seen_subcommand_from completions" -s h -l help -d 'Prints help information'
complete -c innernet -n "__fish_seen_subcommand_from completions" -s V -l version -d 'Prints version information'
complete -c innernet -n "__fish_seen_subcommand_from help" -s h -l help -d 'Prints help information'
complete -c innernet -n "__fish_seen_subcommand_from help" -s V -l version -d 'Prints version information'

View File

@ -26,13 +26,13 @@ Register-ArgumentCompleter -Native -CommandName 'innernet' -ScriptBlock {
[CompletionResult]::new('--data-dir', 'data-dir', [CompletionResultType]::ParameterName, 'data-dir') [CompletionResult]::new('--data-dir', 'data-dir', [CompletionResultType]::ParameterName, 'data-dir')
[CompletionResult]::new('--backend', 'backend', [CompletionResultType]::ParameterName, 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability') [CompletionResult]::new('--backend', 'backend', [CompletionResultType]::ParameterName, 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability')
[CompletionResult]::new('--mtu', 'mtu', [CompletionResultType]::ParameterName, 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)') [CompletionResult]::new('--mtu', 'mtu', [CompletionResultType]::ParameterName, 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Verbose output, use -vv for even higher verbositude') [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'Verbose output, use -vv for even higher verbositude')
[CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Verbose output, use -vv for even higher verbositude') [CompletionResult]::new('--verbose', 'verbose', [CompletionResultType]::ParameterName, 'Verbose output, use -vv for even higher verbositude')
[CompletionResult]::new('--no-routing', 'no-routing', [CompletionResultType]::ParameterName, 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld') [CompletionResult]::new('--no-routing', 'no-routing', [CompletionResultType]::ParameterName, 'Whether the routing should be done by innernet or is done by an external tool like e.g. babeld')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('install', 'install', [CompletionResultType]::ParameterValue, 'Install a new innernet config') [CompletionResult]::new('install', 'install', [CompletionResultType]::ParameterValue, 'Install a new innernet config')
[CompletionResult]::new('show', 'show', [CompletionResultType]::ParameterValue, 'Enumerate all innernet connections') [CompletionResult]::new('show', 'show', [CompletionResultType]::ParameterValue, 'Enumerate all innernet connections')
[CompletionResult]::new('up', 'up', [CompletionResultType]::ParameterValue, 'Bring up your local interface, and update it with latest peer list') [CompletionResult]::new('up', 'up', [CompletionResultType]::ParameterValue, 'Bring up your local interface, and update it with latest peer list')
@ -52,7 +52,7 @@ Register-ArgumentCompleter -Native -CommandName 'innernet' -ScriptBlock {
[CompletionResult]::new('set-listen-port', 'set-listen-port', [CompletionResultType]::ParameterValue, 'Set the local listen port') [CompletionResult]::new('set-listen-port', 'set-listen-port', [CompletionResultType]::ParameterValue, 'Set the local listen port')
[CompletionResult]::new('override-endpoint', 'override-endpoint', [CompletionResultType]::ParameterValue, 'Override your external endpoint that the server sends to other peers') [CompletionResult]::new('override-endpoint', 'override-endpoint', [CompletionResultType]::ParameterValue, 'Override your external endpoint that the server sends to other peers')
[CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generate shell completion scripts') [CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generate shell completion scripts')
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Prints this message or the help of the given subcommand(s)') [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')
break break
} }
'innernet;install' { 'innernet;install' {
@ -65,10 +65,8 @@ Register-ArgumentCompleter -Native -CommandName 'innernet' -ScriptBlock {
[CompletionResult]::new('--delete-invite', 'delete-invite', [CompletionResultType]::ParameterName, 'Delete the invitation after a successful install') [CompletionResult]::new('--delete-invite', 'delete-invite', [CompletionResultType]::ParameterName, 'Delete the invitation after a successful install')
[CompletionResult]::new('--no-nat-traversal', 'no-nat-traversal', [CompletionResultType]::ParameterName, 'Don''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates') [CompletionResult]::new('--no-nat-traversal', 'no-nat-traversal', [CompletionResultType]::ParameterName, 'Don''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates')
[CompletionResult]::new('--no-nat-candidates', 'no-nat-candidates', [CompletionResultType]::ParameterName, 'Don''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates ''0.0.0.0/0''') [CompletionResult]::new('--no-nat-candidates', 'no-nat-candidates', [CompletionResultType]::ParameterName, 'Don''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates ''0.0.0.0/0''')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;show' { 'innernet;show' {
@ -76,10 +74,8 @@ Register-ArgumentCompleter -Native -CommandName 'innernet' -ScriptBlock {
[CompletionResult]::new('--short', 'short', [CompletionResultType]::ParameterName, 'One-line peer list') [CompletionResult]::new('--short', 'short', [CompletionResultType]::ParameterName, 'One-line peer list')
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Display peers in a tree based on the CIDRs') [CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Display peers in a tree based on the CIDRs')
[CompletionResult]::new('--tree', 'tree', [CompletionResultType]::ParameterName, 'Display peers in a tree based on the CIDRs') [CompletionResult]::new('--tree', 'tree', [CompletionResultType]::ParameterName, 'Display peers in a tree based on the CIDRs')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;up' { 'innernet;up' {
@ -91,10 +87,8 @@ Register-ArgumentCompleter -Native -CommandName 'innernet' -ScriptBlock {
[CompletionResult]::new('--no-write-hosts', 'no-write-hosts', [CompletionResultType]::ParameterName, 'Don''t write to any hosts files') [CompletionResult]::new('--no-write-hosts', 'no-write-hosts', [CompletionResultType]::ParameterName, 'Don''t write to any hosts files')
[CompletionResult]::new('--no-nat-traversal', 'no-nat-traversal', [CompletionResultType]::ParameterName, 'Don''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates') [CompletionResult]::new('--no-nat-traversal', 'no-nat-traversal', [CompletionResultType]::ParameterName, 'Don''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates')
[CompletionResult]::new('--no-nat-candidates', 'no-nat-candidates', [CompletionResultType]::ParameterName, 'Don''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates ''0.0.0.0/0''') [CompletionResult]::new('--no-nat-candidates', 'no-nat-candidates', [CompletionResultType]::ParameterName, 'Don''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates ''0.0.0.0/0''')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;fetch' { 'innernet;fetch' {
@ -103,24 +97,18 @@ Register-ArgumentCompleter -Native -CommandName 'innernet' -ScriptBlock {
[CompletionResult]::new('--no-write-hosts', 'no-write-hosts', [CompletionResultType]::ParameterName, 'Don''t write to any hosts files') [CompletionResult]::new('--no-write-hosts', 'no-write-hosts', [CompletionResultType]::ParameterName, 'Don''t write to any hosts files')
[CompletionResult]::new('--no-nat-traversal', 'no-nat-traversal', [CompletionResultType]::ParameterName, 'Don''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates') [CompletionResult]::new('--no-nat-traversal', 'no-nat-traversal', [CompletionResultType]::ParameterName, 'Don''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates')
[CompletionResult]::new('--no-nat-candidates', 'no-nat-candidates', [CompletionResultType]::ParameterName, 'Don''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates ''0.0.0.0/0''') [CompletionResult]::new('--no-nat-candidates', 'no-nat-candidates', [CompletionResultType]::ParameterName, 'Don''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates ''0.0.0.0/0''')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;uninstall' { 'innernet;uninstall' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;down' { 'innernet;down' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;add-peer' { 'innernet;add-peer' {
@ -132,20 +120,16 @@ Register-ArgumentCompleter -Native -CommandName 'innernet' -ScriptBlock {
[CompletionResult]::new('--invite-expires', 'invite-expires', [CompletionResultType]::ParameterName, 'Invite expiration period (eg. ''30d'', ''7w'', ''2h'', ''60m'', ''1000s'')') [CompletionResult]::new('--invite-expires', 'invite-expires', [CompletionResultType]::ParameterName, 'Invite expiration period (eg. ''30d'', ''7w'', ''2h'', ''60m'', ''1000s'')')
[CompletionResult]::new('--auto-ip', 'auto-ip', [CompletionResultType]::ParameterName, 'Auto-assign the peer the first available IP within the CIDR') [CompletionResult]::new('--auto-ip', 'auto-ip', [CompletionResultType]::ParameterName, 'Auto-assign the peer the first available IP within the CIDR')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation') [CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;rename-peer' { 'innernet;rename-peer' {
[CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'Name of peer to rename') [CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'Name of peer to rename')
[CompletionResult]::new('--new-name', 'new-name', [CompletionResultType]::ParameterName, 'The new name of the peer') [CompletionResult]::new('--new-name', 'new-name', [CompletionResultType]::ParameterName, 'The new name of the peer')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation') [CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;add-cidr' { 'innernet;add-cidr' {
@ -153,63 +137,47 @@ Register-ArgumentCompleter -Native -CommandName 'innernet' -ScriptBlock {
[CompletionResult]::new('--cidr', 'cidr', [CompletionResultType]::ParameterName, 'The CIDR network (eg. ''10.42.5.0/24'')') [CompletionResult]::new('--cidr', 'cidr', [CompletionResultType]::ParameterName, 'The CIDR network (eg. ''10.42.5.0/24'')')
[CompletionResult]::new('--parent', 'parent', [CompletionResultType]::ParameterName, 'The CIDR parent name') [CompletionResult]::new('--parent', 'parent', [CompletionResultType]::ParameterName, 'The CIDR parent name')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation') [CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;delete-cidr' { 'innernet;delete-cidr' {
[CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'The CIDR name (eg. ''engineers'')') [CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'The CIDR name (eg. ''engineers'')')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation') [CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;list-cidrs' { 'innernet;list-cidrs' {
[CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Display CIDRs in tree format') [CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'Display CIDRs in tree format')
[CompletionResult]::new('--tree', 'tree', [CompletionResultType]::ParameterName, 'Display CIDRs in tree format') [CompletionResult]::new('--tree', 'tree', [CompletionResultType]::ParameterName, 'Display CIDRs in tree format')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;disable-peer' { 'innernet;disable-peer' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;enable-peer' { 'innernet;enable-peer' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;add-association' { 'innernet;add-association' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;delete-association' { 'innernet;delete-association' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;list-associations' { 'innernet;list-associations' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;set-listen-port' { 'innernet;set-listen-port' {
@ -218,10 +186,8 @@ Register-ArgumentCompleter -Native -CommandName 'innernet' -ScriptBlock {
[CompletionResult]::new('-u', 'u', [CompletionResultType]::ParameterName, 'Unset the local listen port to use a randomized port') [CompletionResult]::new('-u', 'u', [CompletionResultType]::ParameterName, 'Unset the local listen port to use a randomized port')
[CompletionResult]::new('--unset', 'unset', [CompletionResultType]::ParameterName, 'Unset the local listen port to use a randomized port') [CompletionResult]::new('--unset', 'unset', [CompletionResultType]::ParameterName, 'Unset the local listen port to use a randomized port')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation') [CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;override-endpoint' { 'innernet;override-endpoint' {
@ -230,24 +196,16 @@ Register-ArgumentCompleter -Native -CommandName 'innernet' -ScriptBlock {
[CompletionResult]::new('-u', 'u', [CompletionResultType]::ParameterName, 'Unset an existing override to use the automatic endpoint discovery') [CompletionResult]::new('-u', 'u', [CompletionResultType]::ParameterName, 'Unset an existing override to use the automatic endpoint discovery')
[CompletionResult]::new('--unset', 'unset', [CompletionResultType]::ParameterName, 'Unset an existing override to use the automatic endpoint discovery') [CompletionResult]::new('--unset', 'unset', [CompletionResultType]::ParameterName, 'Unset an existing override to use the automatic endpoint discovery')
[CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation') [CompletionResult]::new('--yes', 'yes', [CompletionResultType]::ParameterName, 'Bypass confirmation')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;completions' { 'innernet;completions' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information') [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
'innernet;help' { 'innernet;help' {
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
break break
} }
}) })

View File

@ -15,19 +15,19 @@ _innernet() {
local context curcontext="$curcontext" state line local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-c+[]' \ '-c+[]:CONFIG_DIR: ' \
'--config-dir=[]' \ '--config-dir=[]:CONFIG_DIR: ' \
'-d+[]' \ '-d+[]:DATA_DIR: ' \
'--data-dir=[]' \ '--data-dir=[]:DATA_DIR: ' \
'--backend=[Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability]: :(kernel userspace)' \ '--backend=[Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability]:BACKEND:(kernel userspace)' \
'--mtu=[Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)]' \ '--mtu=[Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)]:MTU: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'*-v[Verbose output, use -vv for even higher verbositude]' \ '*-v[Verbose output, use -vv for even higher verbositude]' \
'*--verbose[Verbose output, use -vv for even higher verbositude]' \ '*--verbose[Verbose output, use -vv for even higher verbositude]' \
'--no-routing[Whether the routing should be done by innernet or is done by an external tool like e.g. babeld]' \ '--no-routing[Whether the routing should be done by innernet or is done by an external tool like e.g. babeld]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
":: :_innernet_commands" \ ":: :_innernet_commands" \
"*::: :->innernet" \ "*::: :->innernet" \
&& ret=0 && ret=0
@ -37,53 +37,20 @@ _innernet() {
(( CURRENT += 1 )) (( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:innernet-command-$line[1]:" curcontext="${curcontext%:*:*}:innernet-command-$line[1]:"
case $line[1] in case $line[1] in
(redeem) (install)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--hosts-path=[The path to write hosts to]' \ '--hosts-path=[The path to write hosts to]:HOSTS_PATH: ' \
'(--default-name)--name=[Set a specific interface name]' \ '(--default-name)--name=[Set a specific interface name]:NAME: ' \
'*--exclude-nat-candidates=[Exclude one or more CIDRs from NAT candidate reporting. ex. --exclude-nat-candidates '\''0.0.0.0/0'\'' would report no candidates]' \ '*--exclude-nat-candidates=[Exclude one or more CIDRs from NAT candidate reporting. ex. --exclude-nat-candidates '\''0.0.0.0/0'\'' would report no candidates]:EXCLUDE_NAT_CANDIDATES: ' \
'(--hosts-path)--no-write-hosts[Don'\''t write to any hosts files]' \ '(--hosts-path)--no-write-hosts[Don'\''t write to any hosts files]' \
'--default-name[Use the network name inside the invitation as the interface name]' \ '--default-name[Use the network name inside the invitation as the interface name]' \
'-d[Delete the invitation after a successful install]' \ '-d[Delete the invitation after a successful install]' \
'--delete-invite[Delete the invitation after a successful install]' \ '--delete-invite[Delete the invitation after a successful install]' \
'--no-nat-traversal[Don'\''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates]' \ '--no-nat-traversal[Don'\''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates]' \
'(--exclude-nat-candidates)--no-nat-candidates[Don'\''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates '\''0.0.0.0/0'\'']' \ '(--exclude-nat-candidates)--no-nat-candidates[Don'\''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates '\''0.0.0.0/0'\'']' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':invite -- Path to the invitation file:' \
'--version[Prints version information]' \
':invite -- Path to the invitation file:_files' \
&& ret=0
;;
(install)
_arguments "${_arguments_options[@]}" \
'--hosts-path=[The path to write hosts to]' \
'(--default-name)--name=[Set a specific interface name]' \
'*--exclude-nat-candidates=[Exclude one or more CIDRs from NAT candidate reporting. ex. --exclude-nat-candidates '\''0.0.0.0/0'\'' would report no candidates]' \
'(--hosts-path)--no-write-hosts[Don'\''t write to any hosts files]' \
'--default-name[Use the network name inside the invitation as the interface name]' \
'-d[Delete the invitation after a successful install]' \
'--delete-invite[Delete the invitation after a successful install]' \
'--no-nat-traversal[Don'\''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates]' \
'(--exclude-nat-candidates)--no-nat-candidates[Don'\''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates '\''0.0.0.0/0'\'']' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
':invite -- Path to the invitation file:_files' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" \
'-s[One-line peer list]' \
'--short[One-line peer list]' \
'-t[Display peers in a tree based on the CIDRs]' \
'--tree[Display peers in a tree based on the CIDRs]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::interface:_files' \
&& ret=0 && ret=0
;; ;;
(show) (show)
@ -92,216 +59,176 @@ _arguments "${_arguments_options[@]}" \
'--short[One-line peer list]' \ '--short[One-line peer list]' \
'-t[Display peers in a tree based on the CIDRs]' \ '-t[Display peers in a tree based on the CIDRs]' \
'--tree[Display peers in a tree based on the CIDRs]' \ '--tree[Display peers in a tree based on the CIDRs]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ '::interface:' \
'--version[Prints version information]' \
'::interface:_files' \
&& ret=0 && ret=0
;; ;;
(up) (up)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--interval=[Keep fetching the latest peer list at the specified interval in seconds. Valid only in daemon mode]' \ '--interval=[Keep fetching the latest peer list at the specified interval in seconds. Valid only in daemon mode]:INTERVAL: ' \
'--hosts-path=[The path to write hosts to]' \ '--hosts-path=[The path to write hosts to]:HOSTS_PATH: ' \
'*--exclude-nat-candidates=[Exclude one or more CIDRs from NAT candidate reporting. ex. --exclude-nat-candidates '\''0.0.0.0/0'\'' would report no candidates]' \ '*--exclude-nat-candidates=[Exclude one or more CIDRs from NAT candidate reporting. ex. --exclude-nat-candidates '\''0.0.0.0/0'\'' would report no candidates]:EXCLUDE_NAT_CANDIDATES: ' \
'-d[Enable daemon mode i.e. keep the process running, while fetching the latest peer list periodically]' \ '-d[Enable daemon mode i.e. keep the process running, while fetching the latest peer list periodically]' \
'--daemon[Enable daemon mode i.e. keep the process running, while fetching the latest peer list periodically]' \ '--daemon[Enable daemon mode i.e. keep the process running, while fetching the latest peer list periodically]' \
'(--hosts-path)--no-write-hosts[Don'\''t write to any hosts files]' \ '(--hosts-path)--no-write-hosts[Don'\''t write to any hosts files]' \
'--no-nat-traversal[Don'\''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates]' \ '--no-nat-traversal[Don'\''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates]' \
'(--exclude-nat-candidates)--no-nat-candidates[Don'\''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates '\''0.0.0.0/0'\'']' \ '(--exclude-nat-candidates)--no-nat-candidates[Don'\''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates '\''0.0.0.0/0'\'']' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ '::interface:' \
'--version[Prints version information]' \
'::interface:_files' \
&& ret=0 && ret=0
;; ;;
(fetch) (fetch)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--hosts-path=[The path to write hosts to]' \ '--hosts-path=[The path to write hosts to]:HOSTS_PATH: ' \
'*--exclude-nat-candidates=[Exclude one or more CIDRs from NAT candidate reporting. ex. --exclude-nat-candidates '\''0.0.0.0/0'\'' would report no candidates]' \ '*--exclude-nat-candidates=[Exclude one or more CIDRs from NAT candidate reporting. ex. --exclude-nat-candidates '\''0.0.0.0/0'\'' would report no candidates]:EXCLUDE_NAT_CANDIDATES: ' \
'(--hosts-path)--no-write-hosts[Don'\''t write to any hosts files]' \ '(--hosts-path)--no-write-hosts[Don'\''t write to any hosts files]' \
'--no-nat-traversal[Don'\''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates]' \ '--no-nat-traversal[Don'\''t attempt NAT traversal. Note that this still will report candidates unless you also specify to exclude all NAT candidates]' \
'(--exclude-nat-candidates)--no-nat-candidates[Don'\''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates '\''0.0.0.0/0'\'']' \ '(--exclude-nat-candidates)--no-nat-candidates[Don'\''t report any candidates to coordinating server. Shorthand for --exclude-nat-candidates '\''0.0.0.0/0'\'']' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(uninstall) (uninstall)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(down) (down)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(add-peer) (add-peer)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--name=[Name of new peer]' \ '--name=[Name of new peer]:NAME: ' \
'(--auto-ip)--ip=[Specify desired IP of new peer (within parent CIDR)]' \ '(--auto-ip)--ip=[Specify desired IP of new peer (within parent CIDR)]:IP: ' \
'--cidr=[Name of CIDR to add new peer under]' \ '--cidr=[Name of CIDR to add new peer under]:CIDR: ' \
'--admin=[Make new peer an admin?]' \ '--admin=[Make new peer an admin?]:ADMIN: ' \
'--save-config=[Save the config to the given location]' \ '--save-config=[Save the config to the given location]:SAVE_CONFIG: ' \
'--invite-expires=[Invite expiration period (eg. '\''30d'\'', '\''7w'\'', '\''2h'\'', '\''60m'\'', '\''1000s'\'')]' \ '--invite-expires=[Invite expiration period (eg. '\''30d'\'', '\''7w'\'', '\''2h'\'', '\''60m'\'', '\''1000s'\'')]:INVITE_EXPIRES: ' \
'--auto-ip[Auto-assign the peer the first available IP within the CIDR]' \ '--auto-ip[Auto-assign the peer the first available IP within the CIDR]' \
'--yes[Bypass confirmation]' \ '--yes[Bypass confirmation]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(rename-peer) (rename-peer)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--name=[Name of peer to rename]' \ '--name=[Name of peer to rename]:NAME: ' \
'--new-name=[The new name of the peer]' \ '--new-name=[The new name of the peer]:NEW_NAME: ' \
'--yes[Bypass confirmation]' \ '--yes[Bypass confirmation]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(add-cidr) (add-cidr)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--name=[The CIDR name (eg. '\''engineers'\'')]' \ '--name=[The CIDR name (eg. '\''engineers'\'')]:NAME: ' \
'--cidr=[The CIDR network (eg. '\''10.42.5.0/24'\'')]' \ '--cidr=[The CIDR network (eg. '\''10.42.5.0/24'\'')]:CIDR: ' \
'--parent=[The CIDR parent name]' \ '--parent=[The CIDR parent name]:PARENT: ' \
'--yes[Bypass confirmation]' \ '--yes[Bypass confirmation]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(delete-cidr) (delete-cidr)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'--name=[The CIDR name (eg. '\''engineers'\'')]' \ '--name=[The CIDR name (eg. '\''engineers'\'')]:NAME: ' \
'--yes[Bypass confirmation]' \ '--yes[Bypass confirmation]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(list-cidrs) (list-cidrs)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-t[Display CIDRs in tree format]' \ '-t[Display CIDRs in tree format]' \
'--tree[Display CIDRs in tree format]' \ '--tree[Display CIDRs in tree format]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(disable-peer) (disable-peer)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(enable-peer) (enable-peer)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(add-association) (add-association)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \ '::cidr1 -- The first cidr to associate:' \
':interface:_files' \ '::cidr2 -- The second cidr to associate:' \
'::cidr1 -- The first cidr to associate:_files' \
'::cidr2 -- The second cidr to associate:_files' \
&& ret=0 && ret=0
;; ;;
(delete-association) (delete-association)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(list-associations) (list-associations)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(set-listen-port) (set-listen-port)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-l+[The listen port you'\''d like to set for the interface]' \ '-l+[The listen port you'\''d like to set for the interface]:LISTEN_PORT: ' \
'--listen-port=[The listen port you'\''d like to set for the interface]' \ '--listen-port=[The listen port you'\''d like to set for the interface]:LISTEN_PORT: ' \
'(-l --listen-port)-u[Unset the local listen port to use a randomized port]' \ '(-l --listen-port)-u[Unset the local listen port to use a randomized port]' \
'(-l --listen-port)--unset[Unset the local listen port to use a randomized port]' \ '(-l --listen-port)--unset[Unset the local listen port to use a randomized port]' \
'--yes[Bypass confirmation]' \ '--yes[Bypass confirmation]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(override-endpoint) (override-endpoint)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-e+[The listen port you'\''d like to set for the interface]' \ '-e+[The listen port you'\''d like to set for the interface]:ENDPOINT: ' \
'--endpoint=[The listen port you'\''d like to set for the interface]' \ '--endpoint=[The listen port you'\''d like to set for the interface]:ENDPOINT: ' \
'(-e --endpoint)-u[Unset an existing override to use the automatic endpoint discovery]' \ '(-e --endpoint)-u[Unset an existing override to use the automatic endpoint discovery]' \
'(-e --endpoint)--unset[Unset an existing override to use the automatic endpoint discovery]' \ '(-e --endpoint)--unset[Unset an existing override to use the automatic endpoint discovery]' \
'--yes[Bypass confirmation]' \ '--yes[Bypass confirmation]' \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':interface:' \
'--version[Prints version information]' \
':interface:_files' \
&& ret=0 && ret=0
;; ;;
(completions) (completions)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \ '-h[Print help information]' \
'--help[Prints help information]' \ '--help[Print help information]' \
'-V[Prints version information]' \ ':shell:(bash elvish fish powershell zsh)' \
'--version[Prints version information]' \
':shell:(zsh bash fish powershell elvish)' \
&& ret=0 && ret=0
;; ;;
(help) (help)
_arguments "${_arguments_options[@]}" \ _arguments "${_arguments_options[@]}" \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
&& ret=0 && ret=0
;; ;;
esac esac
@ -312,195 +239,127 @@ esac
(( $+functions[_innernet_commands] )) || (( $+functions[_innernet_commands] )) ||
_innernet_commands() { _innernet_commands() {
local commands; commands=( local commands; commands=(
"install:Install a new innernet config" \ 'install:Install a new innernet config' \
"show:Enumerate all innernet connections" \ 'show:Enumerate all innernet connections' \
"up:Bring up your local interface, and update it with latest peer list" \ 'up:Bring up your local interface, and update it with latest peer list' \
"fetch:Fetch and update your local interface with the latest peer list" \ 'fetch:Fetch and update your local interface with the latest peer list' \
"uninstall:Uninstall an innernet network" \ 'uninstall:Uninstall an innernet network' \
"down:Bring down the interface (equivalent to 'wg-quick down <interface>')" \ 'down:Bring down the interface (equivalent to '\''wg-quick down <interface>'\'')' \
"add-peer:Add a new peer" \ 'add-peer:Add a new peer' \
"rename-peer:Rename a peer" \ 'rename-peer:Rename a peer' \
"add-cidr:Add a new CIDR" \ 'add-cidr:Add a new CIDR' \
"delete-cidr:Delete a CIDR" \ 'delete-cidr:Delete a CIDR' \
"list-cidrs:List CIDRs" \ 'list-cidrs:List CIDRs' \
"disable-peer:Disable an enabled peer" \ 'disable-peer:Disable an enabled peer' \
"enable-peer:Enable a disabled peer" \ 'enable-peer:Enable a disabled peer' \
"add-association:Add an association between CIDRs" \ 'add-association:Add an association between CIDRs' \
"delete-association:Delete an association between CIDRs" \ 'delete-association:Delete an association between CIDRs' \
"list-associations:List existing assocations between CIDRs" \ 'list-associations:List existing assocations between CIDRs' \
"set-listen-port:Set the local listen port" \ 'set-listen-port:Set the local listen port' \
"override-endpoint:Override your external endpoint that the server sends to other peers" \ 'override-endpoint:Override your external endpoint that the server sends to other peers' \
"completions:Generate shell completion scripts" \ 'completions:Generate shell completion scripts' \
"help:Prints this message or the help of the given subcommand(s)" \ 'help:Print this message or the help of the given subcommand(s)' \
) )
_describe -t commands 'innernet commands' commands "$@" _describe -t commands 'innernet commands' commands "$@"
} }
(( $+functions[_innernet__add-association_commands] )) || (( $+functions[_innernet__add-association_commands] )) ||
_innernet__add-association_commands() { _innernet__add-association_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet add-association commands' commands "$@" _describe -t commands 'innernet add-association commands' commands "$@"
} }
(( $+functions[_innernet__add-cidr_commands] )) || (( $+functions[_innernet__add-cidr_commands] )) ||
_innernet__add-cidr_commands() { _innernet__add-cidr_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet add-cidr commands' commands "$@" _describe -t commands 'innernet add-cidr commands' commands "$@"
} }
(( $+functions[_innernet__add-peer_commands] )) || (( $+functions[_innernet__add-peer_commands] )) ||
_innernet__add-peer_commands() { _innernet__add-peer_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet add-peer commands' commands "$@" _describe -t commands 'innernet add-peer commands' commands "$@"
} }
(( $+functions[_innernet__completions_commands] )) || (( $+functions[_innernet__completions_commands] )) ||
_innernet__completions_commands() { _innernet__completions_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet completions commands' commands "$@" _describe -t commands 'innernet completions commands' commands "$@"
} }
(( $+functions[_innernet__delete-association_commands] )) || (( $+functions[_innernet__delete-association_commands] )) ||
_innernet__delete-association_commands() { _innernet__delete-association_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet delete-association commands' commands "$@" _describe -t commands 'innernet delete-association commands' commands "$@"
} }
(( $+functions[_innernet__delete-cidr_commands] )) || (( $+functions[_innernet__delete-cidr_commands] )) ||
_innernet__delete-cidr_commands() { _innernet__delete-cidr_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet delete-cidr commands' commands "$@" _describe -t commands 'innernet delete-cidr commands' commands "$@"
} }
(( $+functions[_innernet__disable-peer_commands] )) || (( $+functions[_innernet__disable-peer_commands] )) ||
_innernet__disable-peer_commands() { _innernet__disable-peer_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet disable-peer commands' commands "$@" _describe -t commands 'innernet disable-peer commands' commands "$@"
} }
(( $+functions[_innernet__down_commands] )) || (( $+functions[_innernet__down_commands] )) ||
_innernet__down_commands() { _innernet__down_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet down commands' commands "$@" _describe -t commands 'innernet down commands' commands "$@"
} }
(( $+functions[_innernet__enable-peer_commands] )) || (( $+functions[_innernet__enable-peer_commands] )) ||
_innernet__enable-peer_commands() { _innernet__enable-peer_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet enable-peer commands' commands "$@" _describe -t commands 'innernet enable-peer commands' commands "$@"
} }
(( $+functions[_innernet__fetch_commands] )) || (( $+functions[_innernet__fetch_commands] )) ||
_innernet__fetch_commands() { _innernet__fetch_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet fetch commands' commands "$@" _describe -t commands 'innernet fetch commands' commands "$@"
} }
(( $+functions[_innernet__help_commands] )) || (( $+functions[_innernet__help_commands] )) ||
_innernet__help_commands() { _innernet__help_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet help commands' commands "$@" _describe -t commands 'innernet help commands' commands "$@"
} }
(( $+functions[_innernet__install_commands] )) || (( $+functions[_innernet__install_commands] )) ||
_innernet__install_commands() { _innernet__install_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet install commands' commands "$@" _describe -t commands 'innernet install commands' commands "$@"
} }
(( $+functions[_innernet__list_commands] )) ||
_innernet__list_commands() {
local commands; commands=(
)
_describe -t commands 'innernet list commands' commands "$@"
}
(( $+functions[_list_commands] )) ||
_list_commands() {
local commands; commands=(
)
_describe -t commands 'list commands' commands "$@"
}
(( $+functions[_innernet__list-associations_commands] )) || (( $+functions[_innernet__list-associations_commands] )) ||
_innernet__list-associations_commands() { _innernet__list-associations_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet list-associations commands' commands "$@" _describe -t commands 'innernet list-associations commands' commands "$@"
} }
(( $+functions[_innernet__list-cidrs_commands] )) || (( $+functions[_innernet__list-cidrs_commands] )) ||
_innernet__list-cidrs_commands() { _innernet__list-cidrs_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet list-cidrs commands' commands "$@" _describe -t commands 'innernet list-cidrs commands' commands "$@"
} }
(( $+functions[_innernet__override-endpoint_commands] )) || (( $+functions[_innernet__override-endpoint_commands] )) ||
_innernet__override-endpoint_commands() { _innernet__override-endpoint_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet override-endpoint commands' commands "$@" _describe -t commands 'innernet override-endpoint commands' commands "$@"
} }
(( $+functions[_innernet__redeem_commands] )) ||
_innernet__redeem_commands() {
local commands; commands=(
)
_describe -t commands 'innernet redeem commands' commands "$@"
}
(( $+functions[_redeem_commands] )) ||
_redeem_commands() {
local commands; commands=(
)
_describe -t commands 'redeem commands' commands "$@"
}
(( $+functions[_innernet__rename-peer_commands] )) || (( $+functions[_innernet__rename-peer_commands] )) ||
_innernet__rename-peer_commands() { _innernet__rename-peer_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet rename-peer commands' commands "$@" _describe -t commands 'innernet rename-peer commands' commands "$@"
} }
(( $+functions[_innernet__set-listen-port_commands] )) || (( $+functions[_innernet__set-listen-port_commands] )) ||
_innernet__set-listen-port_commands() { _innernet__set-listen-port_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet set-listen-port commands' commands "$@" _describe -t commands 'innernet set-listen-port commands' commands "$@"
} }
(( $+functions[_innernet__show_commands] )) || (( $+functions[_innernet__show_commands] )) ||
_innernet__show_commands() { _innernet__show_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet show commands' commands "$@" _describe -t commands 'innernet show commands' commands "$@"
} }
(( $+functions[_innernet__uninstall_commands] )) || (( $+functions[_innernet__uninstall_commands] )) ||
_innernet__uninstall_commands() { _innernet__uninstall_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet uninstall commands' commands "$@" _describe -t commands 'innernet uninstall commands' commands "$@"
} }
(( $+functions[_innernet__up_commands] )) || (( $+functions[_innernet__up_commands] )) ||
_innernet__up_commands() { _innernet__up_commands() {
local commands; commands=( local commands; commands=()
)
_describe -t commands 'innernet up commands' commands "$@" _describe -t commands 'innernet up commands' commands "$@"
} }

View File

@ -1,6 +1,6 @@
[package] [package]
name = "netlink-request" name = "netlink-request"
version = "1.5.2" version = "1.5.3-beta.1"
edition = "2021" edition = "2021"
[target.'cfg(target_os = "linux")'.dependencies] [target.'cfg(target_os = "linux")'.dependencies]

View File

@ -6,7 +6,7 @@ license = "MIT"
name = "server" name = "server"
publish = false publish = false
readme = "README.md" readme = "README.md"
version = "1.5.2" version = "1.5.3-beta.1"
[[bin]] [[bin]]
name = "innernet-server" name = "innernet-server"

View File

@ -4,7 +4,7 @@ edition = "2021"
license = "MIT" license = "MIT"
name = "shared" name = "shared"
publish = false publish = false
version = "1.5.2" version = "1.5.3-beta.1"
[dependencies] [dependencies]
anyhow = "1" anyhow = "1"

View File

@ -7,7 +7,7 @@ license = "LGPL-2.1-or-later"
name = "wireguard-control" name = "wireguard-control"
readme = "README.md" readme = "README.md"
repository = "https://github.com/tonarino/innernet" repository = "https://github.com/tonarino/innernet"
version = "1.5.2" version = "1.5.3-beta.1"
[dependencies] [dependencies]
base64 = "0.13" base64 = "0.13"