repl: make the info message a bit smaller
parent
e7cd496c31
commit
03b76d19f1
|
@ -28,7 +28,7 @@ fn main() {
|
||||||
if args.len == 0 || args[0] in ['-', 'repl'] {
|
if args.len == 0 || args[0] in ['-', 'repl'] {
|
||||||
// Running `./v` without args launches repl
|
// Running `./v` without args launches repl
|
||||||
if args.len == 0 {
|
if args.len == 0 {
|
||||||
println('For usage information, quit V REPL using `exit` and use `v help`')
|
println('For usage information, quit V REPL and run `v help`')
|
||||||
}
|
}
|
||||||
util.launch_tool(false, 'vrepl', os.args[1..])
|
util.launch_tool(false, 'vrepl', os.args[1..])
|
||||||
return
|
return
|
||||||
|
|
|
@ -344,6 +344,7 @@ fn handle_conn<T>(conn net.Socket, mut app T) {
|
||||||
conn.close() or {}
|
conn.close() or {}
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
// Parse URL query
|
||||||
if url_words.last().contains('?') {
|
if url_words.last().contains('?') {
|
||||||
tmp_query := url_words.last().all_after('?').split('&').map(it.split('='))
|
tmp_query := url_words.last().all_after('?').split('&').map(it.split('='))
|
||||||
url_words[url_words.len - 1] = url_words.last().all_before('?')
|
url_words[url_words.len - 1] = url_words.last().all_before('?')
|
||||||
|
@ -364,7 +365,7 @@ fn handle_conn<T>(conn net.Socket, mut app T) {
|
||||||
// For example URL `/register` matches route `/:user`, but `fn register()`
|
// For example URL `/register` matches route `/:user`, but `fn register()`
|
||||||
// should be called first.
|
// should be called first.
|
||||||
if (req.method == 'GET' && url_words[0] == method) || (req.method == 'POST' && url_words[0] + '_post' == method) {
|
if (req.method == 'GET' && url_words[0] == method) || (req.method == 'POST' && url_words[0] + '_post' == method) {
|
||||||
println('found method $method')
|
println('easy match method=$method')
|
||||||
app.$method(vars)
|
app.$method(vars)
|
||||||
conn.close() or {}
|
conn.close() or {}
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue