From e62a2509ae65dae8bfcae7aaeadce5aad2ad52a0 Mon Sep 17 00:00:00 2001 From: Shaurya Shubham Date: Tue, 1 Oct 2019 19:40:16 +0530 Subject: [PATCH 1/2] Create exit command documentation Partial fix of issue #711 Some parts have been copied from the fish documentation --- docs/commands/exit.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 docs/commands/exit.md diff --git a/docs/commands/exit.md b/docs/commands/exit.md new file mode 100644 index 0000000000..7441d2ae51 --- /dev/null +++ b/docs/commands/exit.md @@ -0,0 +1,17 @@ +# exit + +Exits the nu shell. If STATUS is supplied, it will be converted to an integer and used as the exit code. Otherwise, the exit code will be that of the last command executed. + +## Examples + +```shell +> exit +``` + +```shell +> exit 1 +``` + +```shell +> exit 0 +``` From caf3015e66a922d86853d3011eb5913bbf3c4d8a Mon Sep 17 00:00:00 2001 From: Shaurya Shubham Date: Wed, 2 Oct 2019 06:55:30 +0530 Subject: [PATCH 2/2] Improved exit command docs --- docs/commands/exit.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/docs/commands/exit.md b/docs/commands/exit.md index 7441d2ae51..0238204f28 100644 --- a/docs/commands/exit.md +++ b/docs/commands/exit.md @@ -1,6 +1,6 @@ # exit -Exits the nu shell. If STATUS is supplied, it will be converted to an integer and used as the exit code. Otherwise, the exit code will be that of the last command executed. +Exits the nu shell. If you have multiple nu shells, use `exit --now` to exit all of them. ## Examples @@ -8,10 +8,23 @@ Exits the nu shell. If STATUS is supplied, it will be converted to an integer an > exit ``` -```shell -> exit 1 ``` - -```shell -> exit 0 +/home/username/stuff/books> shells +---+---+------------+---------------------------- + # | | name | path +---+---+------------+---------------------------- + 0 | | filesystem | /home/username/stuff/notes + 1 | | filesystem | /home/username/stuff/videos + 2 | X | filesystem | /home/username/stuff/books +---+---+------------+---------------------------- +/home/username/stuff/books> exit +/home/username/stuff/videos> shells +---+---+------------+---------------------------- + # | | name | path +---+---+------------+---------------------------- + 0 | | filesystem | /home/username/stuff/notes + 1 | X | filesystem | /home/username/stuff/videos +---+---+------------+---------------------------- +/home/username/stuff/videos> exit --now +exits both the shells ```