From f46eb4bd6003311ae98da802a1c56993baa282f1 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Wed, 7 Jan 2026 15:32:46 -0800 Subject: [PATCH] Better explain how to document extended commands --- spin/cmds/util.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spin/cmds/util.py b/spin/cmds/util.py index e0ca361..1b8ae35 100644 --- a/spin/cmds/util.py +++ b/spin/cmds/util.py @@ -127,7 +127,14 @@ def extend_command( Command to extend. doc : str Replacement docstring. - The wrapped function's docstring is also appended. + The decorated function's docstring is also appended. + This is done so that two modes of documenting are enabled: + + 1. Extend original command documentation. + Do this by providing a docstring on the decorated function. + 2. Replace the original command's documentation. + Do this either by setting ``doc`` to a docstring, or by + setting ``doc=''`` and adding a docstring to the decorated function. remove_args : tuple of str List of arguments to remove from the parent command. These arguments can still be set explicitly by calling