When wondering about the standard, good way of writing something in VimL I usually check two main resources: the Vim documentation, which is extremely comprehensive and well written, and Steve Losh's blogs (Learn Vimscript the Hard Way and Writing Vim Plugins).
One approach to find examples in the Vim documentation is finding the entry on the subject and them check the start of that file; for
This subject is introduced in sections |05.3|, |24.7| and |40.1| of the user
Searching the file for the 40.1 section:
The <f-args> keyword contains the same information as the <args> keyword,
except in a format suitable for use as function call arguments. For example:
:command -nargs=* DoIt :call AFunction(<f-args>)
:DoIt a b c
It shows something similar to what you guessed: calling separated functions, but with arguments.
Unfortunately I couldn't find anything about this subject on the blogs mentioned above.
As was mentioned on the question comments, the alternative is to use
\ as line continuation, but that usually leads to clumsy and hard-to-read/edit code.
There is a pattern that I have seen many times when people use the function approach and the
<bang> which is made available by
command -bang MyCmd call MyFunction(<bang>0, arg2)
This is useful because
<bang> expands on
! or nothing, so concatenating it with
0 makes it easier to check with an
As mentioned by Carpetsmoker, it is better to use script-local
s:a_function() instead of a global
AFunction(), as it is more localized and doesn't appear in tab completions and such.