From 773d7073b7fdd219eb8e11e27744576467fc19bf Mon Sep 17 00:00:00 2001 From: Guilherme Bernal Date: Sat, 29 Jan 2022 13:00:33 -0300 Subject: [PATCH] Fix documentation for macros `system` and `run` (#11740) --- src/compiler/crystal/macros.cr | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/compiler/crystal/macros.cr b/src/compiler/crystal/macros.cr index 7ff383fd5e85..993a0f6b8dd1 100644 --- a/src/compiler/crystal/macros.cr +++ b/src/compiler/crystal/macros.cr @@ -215,7 +215,12 @@ module Crystal::Macros def `(command) : MacroId end - # :ditto: + # Executes a system command and returns the output as a `MacroId`. + # Gives a compile-time error if the command failed to execute. + # + # ``` + # {{ system("echo hi") }} # => "hi\n" + # ``` def system(command) : MacroId end @@ -252,8 +257,8 @@ module Crystal::Macros # # The file denoted by *filename* must be a valid Crystal program. # This macro invocation passes *args* to the program as regular - # program arguments. The program must output a valid Crystal expression. - # This output is the result of this macro invocation, as a `MacroId`. + # program arguments. This output is the result of this macro invocation, + # as a `MacroId`. # # The `run` macro is useful when the subset of available macro methods # are not enough for your purposes and you need something more powerful.