patch 8.1.2233: cannot get the Vim command line arguments
Problem: Cannot get the Vim command line arguments.
Solution: Add v:argv. (Dmitri Vereshchagin, closes #1322)
diff --git a/src/testdir/test_startup.vim b/src/testdir/test_startup.vim
index f10eabb..358ca81 100644
--- a/src/testdir/test_startup.vim
+++ b/src/testdir/test_startup.vim
@@ -671,3 +671,15 @@
" clean up
call StopVimInTerminal(buf)
endfunc
+
+func Test_v_argv()
+ " Can't catch the output of gvim.
+ CheckNotGui
+
+ let out = system(GetVimCommand() . ' -es -V1 -X arg1 --cmd "echo v:argv" --cmd q')
+ let list = out->split("', '")
+ call assert_match('vim', list[0])
+ let idx = index(list, 'arg1')
+ call assert_true(idx > 2)
+ call assert_equal(['arg1', '--cmd', 'echo v:argv', '--cmd', 'q'']'], list[idx:])
+endfunc