[vim/vim] cli: support key=val commandline options (PR #21078)

3 views
Skip to first unread message

dezza

unread,
Aug 17, 2026, 5:59:51 PM (17 hours ago) Aug 17
to vim/vim, Subscribed

Confusing that we don't support the common practise of:

gvim --servername=gvim --clientserver socket # socket -- opened as 'argument 1' as buffer/file option

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/21078

Commit Summary

  • 79e44b0 cli: support key=val commandline opts
  • 62db07a test(cli): add key=val long-opts coverage

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21078@github.com>

h_east

unread,
8:16 AM (3 hours ago) 8:16 AM
to vim/vim, Subscribed
h-east left a comment (vim/vim#21078)

Please split this into two.

First, the silent misparse. In command_line_scan() the long options are
compared with a prefix:

		else if (STRNICMP(argv[0] + argv_idx, "servername", 10) == 0

--servername=test enters that branch and swallows the next argument as its
value. early_arg_scan(), which reads the value, compares with STRICMP()
and does not recognise the same argument, so the name is never set. That is
why --clientserver is eaten and socket is left as a file name, and why
nothing is reported: mainerr(ME_UNKNOWN_OPTION) is never reached.

Please fix that on its own, in a patch that does nothing else: make those
comparisons require the name to end there, so that --servername=test becomes
"Unknown option". It is a small change and the trap is gone.

Second, --option=value support. Vim has no long option that takes a value
with = today, and the form is not documented anywhere, so this adds a new
convention rather than fills a gap.

Which raises the question: once the misparse is fixed, is the feature still
needed? Both examples in the description go wrong because nothing is reported.
With "Unknown option" the mistake is visible at once, and the answer is to
write --servername test. If there is a reason to accept = beyond that,
please say what it is, and let it be discussed on its own rather than as part
of a bug fix.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21078/c5328025624@github.com>

Reply all
Reply to author
Forward
0 new messages