innernet/doc/innernet-server.completions...

104 lines
4.7 KiB
Plaintext
Raw Normal View History

2022-01-11 20:18:19 +00:00
use builtin;
use str;
2022-01-12 22:31:31 +00:00
set edit:completion:arg-completer[innernet-server] = {|@words|
fn spaces {|n|
2022-01-11 20:18:19 +00:00
builtin:repeat $n ' ' | str:join ''
}
2022-01-12 22:31:31 +00:00
fn cand {|text desc|
2022-01-11 20:18:19 +00:00
edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
}
2022-01-11 20:18:19 +00:00
var command = 'innernet-server'
for word $words[1..-1] {
if (str:has-prefix $word '-') {
break
}
2022-01-11 20:18:19 +00:00
set command = $command';'$word
}
2022-01-11 20:18:19 +00:00
var completions = [
&'innernet-server'= {
2021-12-05 17:35:18 +00:00
cand -c 'c'
cand --config-dir 'config-dir'
cand -d 'd'
cand --data-dir 'data-dir'
cand --backend 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability'
2021-06-14 14:53:02 +00:00
cand --mtu 'Specify the desired MTU for your interface (default: 1420 for IPv4 and 1400 for IPv6)'
2022-01-11 20:18:19 +00:00
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 new 'Create a new network'
cand uninstall 'Permanently uninstall a created network, rendering it unusable. Use with care'
cand serve 'Serve the coordinating server for an existing network'
cand add-peer 'Add a peer to an existing network'
2021-05-31 15:23:14 +00:00
cand rename-peer 'Rename an existing peer'
cand add-cidr 'Add a new CIDR to an existing network'
cand delete-cidr 'Delete a CIDR'
cand completions 'Generate shell completion scripts'
2022-01-11 20:18:19 +00:00
cand help 'Print this message or the help of the given subcommand(s)'
}
&'innernet-server;new'= {
cand --network-name 'The network name (ex: evilcorp)'
cand --network-cidr 'The network CIDR (ex: 10.42.0.0/16)'
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 --auto-external-endpoint 'Auto-resolve external endpoint'
2022-01-11 20:18:19 +00:00
cand -h 'Print help information'
cand --help 'Print help information'
}
&'innernet-server;uninstall'= {
2022-01-11 20:18:19 +00:00
cand -h 'Print help information'
cand --help 'Print help information'
}
&'innernet-server;serve'= {
cand --backend 'Specify a WireGuard backend to use. If not set, innernet will auto-select based on availability'
2021-06-14 14:53:02 +00:00
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'
2022-01-11 20:18:19 +00:00
cand -h 'Print help information'
cand --help 'Print help information'
}
&'innernet-server;add-peer'= {
cand --name 'Name of new peer'
cand --ip 'Specify desired IP of new peer (within parent CIDR)'
cand --cidr 'Name of CIDR to add new peer under'
cand --admin 'Make new peer an admin?'
cand --save-config 'Save the config to the given location'
2021-11-11 09:42:21 +00:00
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 --yes 'Bypass confirmation'
2022-01-11 20:18:19 +00:00
cand -h 'Print help information'
cand --help 'Print help information'
}
2021-05-31 15:23:14 +00:00
&'innernet-server;rename-peer'= {
cand --name 'Name of peer to rename'
cand --new-name 'The new name of the peer'
cand --yes 'Bypass confirmation'
2022-01-11 20:18:19 +00:00
cand -h 'Print help information'
cand --help 'Print help information'
2021-05-31 15:23:14 +00:00
}
&'innernet-server;add-cidr'= {
2021-11-11 09:42:21 +00:00
cand --name 'The CIDR name (eg. ''engineers'')'
cand --cidr 'The CIDR network (eg. ''10.42.5.0/24'')'
cand --parent 'The CIDR parent name'
cand --yes 'Bypass confirmation'
2022-01-11 20:18:19 +00:00
cand -h 'Print help information'
cand --help 'Print help information'
}
&'innernet-server;delete-cidr'= {
2021-11-11 09:42:21 +00:00
cand --name 'The CIDR name (eg. ''engineers'')'
cand --yes 'Bypass confirmation'
2022-01-11 20:18:19 +00:00
cand -h 'Print help information'
cand --help 'Print help information'
}
&'innernet-server;completions'= {
2022-01-11 20:18:19 +00:00
cand -h 'Print help information'
cand --help 'Print help information'
}
&'innernet-server;help'= {
}
]
$completions[$command]
}