v icon indicating copy to clipboard operation
v copied to clipboard

vweb: add an option to disable startup message

Open ArthurZhou opened this issue 1 year ago • 5 comments

add msg: false to vweb.RunParams to disable [VWeb] Running app on ... refer to issue #17622

add an option msg: false to RunParams to disable the message msg is true by default

example:

vweb.run_at(&App{}, vweb.RunParams{
		host: "localhost"
		port: 8080
		family: .ip
                msg: false
	})

ArthurZhou avatar Mar 14 '23 10:03 ArthurZhou

Hmm... is it better to have startup_msg as boolean?

What if you want to have a custom startup message?

JalonSolov avatar Mar 14 '23 11:03 JalonSolov

You can print an output manually :) e.g.

println("[Vweb] Running app on http://localhost:8080/")
vweb.run_at(&App{}, vweb.RunParams{
	host: "localhost"
	port: 8080
	family: .ip
	startup_message: false
})

ArthurZhou avatar Mar 14 '23 12:03 ArthurZhou

In V bools are usually named with is_x or show_x to make it clear they are bools.

startup_message sounds like a string, it should be show_startup_message: false

Verbose, but clear.

medvednikov avatar Mar 14 '23 12:03 medvednikov

startup_message sounds like a string, it should be show_startup_message: false

indeed, my bad

spytheman avatar Mar 14 '23 13:03 spytheman

To be truly explicit (and even more verbose), it should be show_default_startup_message - since it only affects the default.

JalonSolov avatar Mar 14 '23 13:03 JalonSolov