From 36938a44072052dd8dd0581c736c592b110dd246 Mon Sep 17 00:00:00 2001 From: Sebastian Jung Date: Fri, 29 Nov 2019 18:15:51 +0100 Subject: [PATCH] add documentation for save, config --- docs/commands/config.md | 15 +++++++-------- docs/commands/save.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 docs/commands/save.md diff --git a/docs/commands/config.md b/docs/commands/config.md index cae8e43ef3..3998b0dea9 100644 --- a/docs/commands/config.md +++ b/docs/commands/config.md @@ -6,7 +6,6 @@ Syntax: `config {flags}` ### Flags - --load load the config from the path give @@ -30,13 +29,13 @@ Syntax: `config {flags}` ### Variables -| Variable | Type | Description | -| ------------- | ------------- | ----- | -| path | table of strings | PATH to use to find binaries | -| env | row | the environment variables to pass to external commands | -| ctrlc_exit | boolean | whether or not to exit Nu after multiple ctrl-c presses | -| table_mode | "light" or other | enable lightweight or normal tables | -| edit_mode | "vi" or "emacs" | changes line editing to "vi" or "emacs" mode | +| Variable | Type | Description | +| ---------- | ---------------- | ------------------------------------------------------- | +| path | table of strings | PATH to use to find binaries | +| env | row | the environment variables to pass to external commands | +| ctrlc_exit | boolean | whether or not to exit Nu after multiple ctrl-c presses | +| table_mode | "light" or other | enable lightweight or normal tables | +| edit_mode | "vi" or "emacs" | changes line editing to "vi" or "emacs" mode | ## Examples diff --git a/docs/commands/save.md b/docs/commands/save.md new file mode 100644 index 0000000000..2ff76f5370 --- /dev/null +++ b/docs/commands/save.md @@ -0,0 +1,28 @@ +# save + +This command saves the contents of the pipeline to a file. Use this in combination with the `to-json`, `to-csv`, ... commands to save the contents in the specified format. + +Syntax: `save (path) {flags}` + +### Parameters: + +* `(path)` the path to save contents to + +### Flags + + --raw + treat values as-is rather than auto-converting based on file extension + +## Example + +You can save the name of files in a directory like this: + +```shell +> ls | where type == File | pick name | save +``` + +Or you can format it in supported formats using one of the `to-*` commands: + +```shell +> ls | where type == File | pick name | to-csv | save +``` \ No newline at end of file