1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: migrate to the new Option (p. 1) (#8924)

This commit is contained in:
spaceface
2021-02-28 20:24:29 +01:00
committed by GitHub
parent e354dcefc2
commit b9a381f101
34 changed files with 244 additions and 214 deletions

View File

@@ -177,7 +177,7 @@ ${flag.space}to script it/run it in a restrictive vps/docker.
context.vc_repo_url = os.real_path(context.vc_repo_url)
}
commits := fp.finalize() or {
eprintln('Error: ' + err)
eprintln('Error: $err')
exit(1)
}
for commit in commits {

View File

@@ -148,7 +148,7 @@ fn (mut context Context) parse_options() {
scripting.set_verbose(true)
}
commands := fp.finalize() or {
eprintln('Error: ' + err)
eprintln('Error: $err')
exit(1)
}
context.commands = context.expand_all_commands(commands)

View File

@@ -210,10 +210,10 @@ fn (vd VDoc) get_readme(path string) string {
return readme_contents
}
fn (vd VDoc) emit_generate_err(err string, errcode int) {
fn (vd VDoc) emit_generate_err(err Error) {
cfg := vd.cfg
mut err_msg := err
if errcode == 1 {
mut err_msg := err.msg
if err.code == 1 {
mod_list := get_modules_list(cfg.input_path, []string{})
println('Available modules:\n==================')
for mod in mod_list {
@@ -288,12 +288,12 @@ fn (mut vd VDoc) generate_docs_from_file() {
vd.vprintln('Generating $out.typ docs for "$dirpath"')
if is_local_and_single {
dcs = doc.generate_with_pos(dirpath, cfg.local_filename, cfg.local_pos) or {
vd.emit_generate_err(err, errcode)
vd.emit_generate_err(err)
exit(1)
}
} else {
dcs = doc.generate(dirpath, cfg.pub_only, true) or {
vd.emit_generate_err(err, errcode)
vd.emit_generate_err(err)
exit(1)
}
}

View File

@@ -377,6 +377,7 @@ fn main() {
mut tsession := testing.new_test_session(cmd_prefix)
tsession.files << all_test_files
tsession.skip_files << skip_test_files
tsession.skip_files << 'vlib/v/tests/option_print_errors_test.v'
mut werror := false
mut sanitize_memory := false
mut sanitize_address := false