From e9e437ce0502a4c39532fa25dbbb4dc3d66d05cc Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 3 Jul 2020 22:30:34 +0200 Subject: [PATCH] repl: show short version --- cmd/tools/vrepl.v | 4 ++-- vlib/v/util/util.v | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/tools/vrepl.v b/cmd/tools/vrepl.v index 7d58adc099..820a5a08ab 100644 --- a/cmd/tools/vrepl.v +++ b/cmd/tools/vrepl.v @@ -76,7 +76,7 @@ fn (r &Repl) current_source_code(should_add_temp_lines bool) string { } fn repl_help() { - println(util.full_v_version(true)) + println(util.full_v_version(false)) println(' help Displays this information. list Show the program so far. @@ -87,7 +87,7 @@ fn repl_help() { } fn run_repl(workdir string, vrepl_prefix string) { - println(util.full_v_version(true)) + println(util.full_v_version(false)) println('Use Ctrl-C or `exit` to exit') file := os.join_path(workdir, '.${vrepl_prefix}vrepl.v') diff --git a/vlib/v/util/util.v b/vlib/v/util/util.v index 19b6b975e1..53516bbda6 100644 --- a/vlib/v/util/util.v +++ b/vlib/v/util/util.v @@ -37,16 +37,16 @@ pub fn full_hash() string { if build_hash == current_hash { return build_hash } - return '${build_hash}.${current_hash}' + return '${build_hash}.$current_hash' } // full_v_version() returns the full version of the V compiler pub fn full_v_version(is_verbose bool) string { if is_verbose { - return 'V ${v_version} ${full_hash()}' + return 'V $v_version $full_hash()' } hash := githash(false) - return 'V ${v_version} $hash' + return 'V $v_version $hash' } // githash(x) returns the current git commit hash. @@ -182,7 +182,7 @@ pub fn launch_tool(is_verbose bool, tool_name string, args []string) { pub fn quote_path_with_spaces(s string) string { if s.contains(' ') { - return '"${s}"' + return '"$s"' } return s } @@ -282,7 +282,7 @@ pub fn check_module_is_installed(modulename string, is_verbose bool) ?bool { } if os.exists(mod_v_file) { vexe := pref.vexe_path() - update_cmd := '"$vexe" update "${modulename}"' + update_cmd := '"$vexe" update "$modulename"' if is_verbose { eprintln('check_module_is_installed: updating with $update_cmd ...') } @@ -290,9 +290,9 @@ pub fn check_module_is_installed(modulename string, is_verbose bool) ?bool { return error('can not start $update_cmd, error: $err') } if update_res.exit_code != 0 { - eprintln('Warning: `${modulename}` exists, but is not updated. + eprintln('Warning: `$modulename` exists, but is not updated. V will continue, since updates can fail due to temporary network problems, -and the existing module `${modulename}` may still work.') +and the existing module `$modulename` may still work.') if is_verbose { eprintln('Details:') eprintln(update_res.output) @@ -337,7 +337,7 @@ pub fn strip_mod_name(name string) string { } pub fn strip_main_name(name string) string { - return name.replace('main.','') + return name.replace('main.', '') } pub fn no_dots(s string) string {