Skip to content

Commit 45d22d0

Browse files
committed
Fix custom command format example
Resolves #4197
1 parent 1b46102 commit 45d22d0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

reference/extensions/custom_commands.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ Main decorator to declare a function as a new Conan command. Where the parameter
6363
import json
6464
6565
from conan.api.conan_api import ConanAPI
66-
from conan.api.output import ConanOutput
66+
from conan.api.output import ConanOutput, cli_out_write
6767
from conan.cli.command import conan_command
6868
6969
def output_json(msg):
70-
return json.dumps({"greet": msg})
70+
myjson = json.dumps({"greet": msg})
71+
cli_out_write(myjson)
7172
7273
7374
@conan_command(group="Custom commands", formatters={"json": output_json})

0 commit comments

Comments
 (0)