Skip to content

Commit 246c021

Browse files
authored
Update docs for sys deprecation in 0.94.0 (#1387)
* Update docs for `sys` deprecation * Add `null` return * Restore old examples * Rework structured data examples * Restore make_docs.nu
1 parent de933d0 commit 246c021

11 files changed

+62
-117
lines changed

book/coming_from_bash.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Note: this table assumes Nu 0.91.0 or later.
4949
| `command1 && command2` | `command1; command2` | Run a command, and if it's successful run a second |
5050
| `stat $(which git)` | `stat (which git).path` | Use command output as argument for other command |
5151
| `echo /tmp/$RANDOM` | `$"/tmp/(random integer)"` | Use command output in a string |
52-
| `cargo b --jobs=$(nproc)` | `cargo b $"--jobs=(sys \| get cpu \| length)"` | Use command output in an option |
52+
| `cargo b --jobs=$(nproc)` | `cargo b $"--jobs=(sys cpu \| length)"` | Use command output in an option |
5353
| `echo $PATH` | `$env.PATH` (Non-Windows) or `$env.Path` (Windows) | See the current path |
5454
| `<update ~/.bashrc>` | `vim $nu.config-path` | Update PATH permanently |
5555
| `export PATH = $PATH:/usr/other/bin` | `$env.PATH = ($env.PATH \| append /usr/other/bin)` | Update PATH temporarily |

book/introduction.md

Lines changed: 0 additions & 73 deletions
This file was deleted.

book/nushell_map.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The idea behind this table is to help you understand how Nu builtins and plugins relate to other known shells and domain specific languages. We've tried to produce a map of relevant Nu commands and what their equivalents are in other languages. Contributions are welcome.
44

5-
Note: this table assumes Nu 0.43 or later.
5+
Note: this table assumes Nu 0.94 or later.
66

77

88
| Nushell | SQL | .Net LINQ (C#) | PowerShell (without external modules) | Bash |
@@ -59,7 +59,9 @@ Note: this table assumes Nu 0.43 or later.
5959
| str join | concat_ws | Join | Join-String | |
6060
| str trim | rtrim, ltrim | Trim, TrimStart, TrimEnd | Trim | |
6161
| sum | sum | Sum | Measure-Object, measure | |
62-
| sys | | | Get-ComputerInfo | uname, lshw, lsblk, lscpu, lsusb, hdparam, free |
62+
| sys host | | | Get-ComputerInfo | uname |
63+
| sys disks | | | Get-ComputerInfo | lsblk |
64+
| sys mem | | | Get-ComputerInfo | free |
6365
| table | | | Format-Table, ft, Format-List, fl | |
6466
| take | top, limit | Take | Select-Object -First | head |
6567
| take until | | TakeWhile | | |

book/nushell_map_imperative.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Note: this table assumes Nu 0.43 or later.
1616
| du | shutil.disk_usage | | | |
1717
| each | for | for | for | for |
1818
| exit | exit | System.exit, kotlin.system.exitProcess | exit | exit |
19-
| http get | urllib.request.urlopen | | | |
19+
| http get | urllib.request.urlopen | | | |
2020
| first | list[:x] | List[0], peek | vector[0], top | Vec[0] |
2121
| format | format | format | format | format! |
2222
| from | csv, json, sqlite3 | | | |
@@ -32,7 +32,7 @@ Note: this table assumes Nu 0.43 or later.
3232
| kill | os.kill | | | |
3333
| last | list[-x:] | | | &Vec[Vec.len()-1] |
3434
| lines | split, splitlines | split | views::split | split, split_whitespace, rsplit, lines |
35-
| ls | os.listdir | | | fs::read_dir |
35+
| ls | os.listdir | | | fs::read_dir |
3636
| match | match | when | | match |
3737
| merge | dict.append | | | map.extend |
3838
| mkdir | os.mkdir | | | fs::create_dir |
@@ -57,20 +57,19 @@ Note: this table assumes Nu 0.43 or later.
5757
| size | len | | | len |
5858
| skip | list[x:] | | | &Vec[x..],skip |
5959
| skip until | itertools.dropwhile | | | |
60-
| skip while | itertools.dropwhile | | | skip_while |
60+
| skip while | itertools.dropwhile | | | skip_while |
6161
| sort-by | sorted, list.sort | sortedBy, sortedWith, Arrays.sort, Collections.sort | sort | sort |
6262
| split row | str.split{,lines}, re.split | split | views::split | split |
6363
| str | str functions | String functions | string functions | &str, String functions |
6464
| str join | str.join | joinToString | | join |
6565
| str trim | strip, rstrip, lstrip | trim, trimStart, trimEnd | regex | trim, trim*{start,end}, strip*{suffix,prefix} |
6666
| sum | sum | sum | reduce | sum |
67-
| sys | sys | | | |
6867
| to | import csv, json, sqlite3 | | | |
6968
| touch | open(path, 'a').close() | | | |
7069
| uniq | set | Set | set | HashSet |
7170
| upsert | dict[\"key\"] = val | | | |
7271
| version | sys.version, sys.version_info | | | |
7372
| with-env | os.environ | | | |
74-
| where | filter | filter | filter | filter |
73+
| where | filter | filter | filter | filter |
7574
| which | shutil.which | | | |
7675
| wrap | { "key" : val } | | | |

book/operators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ operator. You can use the spread multiple records inside a single record literal
213213
...$config,
214214
users: [alice bob],
215215
...{ url: example.com },
216-
...(sys | get mem)
216+
...(sys mem)
217217
}
218218
╭────────────┬───────────────╮
219219
│ path │ /tmp │

0 commit comments

Comments
 (0)