From f9b0b81eb24696c7b6d077b5a7190542931aea3d Mon Sep 17 00:00:00 2001 From: Leonhard Kipp Date: Fri, 15 Jan 2021 08:21:18 +0100 Subject: [PATCH] Add def documentation (#2939) --- docs/commands/def.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 docs/commands/def.md diff --git a/docs/commands/def.md b/docs/commands/def.md new file mode 100644 index 000000000..8570272d8 --- /dev/null +++ b/docs/commands/def.md @@ -0,0 +1,17 @@ +# def + +Use `def` to create a custom command. + +## Examples + +``` +> def my_command [] { echo hi nu } +> my_command +hi nu +``` + +``` +> def my_command [adjective: string, num: int] { echo $adjective $num meet nu } +> my_command nice 2 +nice 2 meet nu +```