Class: WireGuard::Admin::Peers
- Inherits:
-
Thor
- Object
- Thor
- WireGuard::Admin::Peers
- Extended by:
- ClassHelpers
- Includes:
- InstanceHelpers
- Defined in:
- lib/wire_guard/admin/cli/peers.rb
Overview
Commands for working with peers (servers and clients)
Instance Method Summary collapse
Methods included from ClassHelpers
default_network, path, repository
Methods included from InstanceHelpers
Instance Method Details
#list ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/wire_guard/admin/cli/peers.rb', line 19 def list if [:verbose] warn "Using database #{repository.path}" warn "No clients in network #{network}." if repository.networks.empty? end repository.peers(network).each do |peer| if $stdout.tty? puts peer else puts peer.name end end rescue StandardError => e raise Thor::Error, "Error: #{e.}" end |