usage();
else if (STRICMP(argv[0] + argv_idx, "version") == 0)
{
- Columns = 80; // need to init Columns
+ cmdline_width = Columns = 80; // need to init Columns
info_message = TRUE; // use mch_msg(), not mch_errmsg()
# if defined(FEAT_GUI) && !defined(ALWAYS_USE_GUI) && !defined(VIMDLL)
gui.starting = FALSE; // not starting GUI, will exit
call delete('Xtestout')
endfunc
+func Test_version_arg()
+ " This does not work with a GUI-only binary, such as on MS-Windows.
+ CheckAnyOf Unix NotGui
+
+ if RunVim([], [], '--version >Xtestout')
+ let lines = readfile('Xtestout')
+ call assert_true(len(lines) > 10)
+ call assert_match('Vi IMproved', lines[0])
+
+ let idx = indexof(lines, 'v:val =~# "Features included.*:"')
+ call assert_true(idx >= 0)
+ call assert_true(idx + 1 < len(lines))
+ " Make sure the feature name is doubled on a line.
+ " For example, "+acl +jumplist"
+ let feat_name = '[+-]+\?\w\+\%(()\)\?'
+ call assert_match($'^{feat_name}\s\+{feat_name}', lines[idx+1])
+ endif
+ call delete('Xtestout')
+endfunc
+
func Test_compatible_args()
let after =<< trim [CODE]
call writefile([string(&compatible)], "Xtestout")