make mildly safer

This commit is contained in:
Mewrry the Kitty 2026-02-07 17:36:50 -06:00
parent c32a4143dc
commit 41bb37b3c6

View file

@ -17,11 +17,11 @@ options = {
}
OptionParser.new do |opt|
opt.on('-pPORT', '--port PORT', Integer,
'Port to serve/listen on (defaults to 7570)') do |o|
'Port to serve/listen on (defaults to 7570)') do |o|
options[:port] = o
end
opt.on('-S', '--server',
'Make this instance function as a server.'
'Make this instance function as a server'
) do
options[:server] = true
end
@ -44,11 +44,13 @@ OptionParser.new do |opt|
) do |o|
options[:cols] = o
end
opt.on('-X', '--public',
opt.on('--expose-this-instance-for-the-world-to-see-because-I-know-what-I\'m-doing [please]',
# X -- eXposed
'(server only) Serve publicly, rather than privately'
) do
options[:server_host] = PUBLIC_HOST
'(server only) Serve publicly, rather than privately. Please ONLY add this option if you entierly know what you\'re doing and have permission from/are the server owner. Say please to expose.'
) do |o|
if o == "please"
options[:server_host] = PUBLIC_HOST
end
end
opt.on('-x', '--private',
# x -- not visible
@ -80,6 +82,7 @@ def do_server
puts "PORT: #{PORT}"
puts "GRID SIZE: #{ROWS}r#{COLS}c"
if SRV_HOST == PUBLIC_HOST then puts "EXPOSED" end
puts 'Listening...'
pre = "#{ROWS}r#{COLS}c >>> "