Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update intro for latest Nu version #264

Merged
merged 2 commits into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
Update intro snippets for Nu v0.59
  • Loading branch information
rgwood committed Mar 7, 2022
commit b0352972c15e3e6d0c120eeb2822bb4cbecc10dc
2 changes: 1 addition & 1 deletion snippets/introduction/date_example.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
> date now
2020-09-09 09:14:51.684619600 +00:00
2022-03-07 14:14:51.684619600 -08:00
10 changes: 5 additions & 5 deletions snippets/introduction/date_table_example.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
> date now | date to-table
───┬──────┬───────┬─────┬──────┬────────┬────────┬──────────
# │ year │ month │ day │ hour │ minute │ second │ timezone
───┼──────┼───────┼─────┼──────┼────────┼────────┼──────────
0 │ 202099 9 1451 │ +00:00
───┴──────┴───────┴─────┴──────┴────────┴────────┴──────────
───┬──────┬───────┬─────┬──────┬────────┬────────┬──────────
# │ year │ month │ day │ hour │ minute │ second │ timezone
───┼──────┼───────┼─────┼──────┼────────┼────────┼──────────
0 │ 20223714 45 3 │ -08:00
───┴──────┴───────┴─────┴──────┴────────┴────────┴──────────
4 changes: 3 additions & 1 deletion snippets/introduction/help_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ There are three ways to represent a path:
* As an inner list of path parts, e.g., '[[ / home viking spam.txt ]]'.
Splitting into parts is done by the `path split` command.

All subcommands accept all three variants as an input. Furthermore, the 'path
join' subcommand can be used to join the structured path or path parts back into
the path literal.

Usage:
> path
> path

Subcommands:
path basename - Get the final component of a path
Expand All @@ -29,3 +30,4 @@ Subcommands:

Flags:
-h, --help
Display this help message
18 changes: 9 additions & 9 deletions snippets/introduction/ls_example.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
> ls
────┬────────────────────┬──────┬────────┬────────────
# │ name │ type │ size modified
────┼────────────────────┼──────┼────────┼────────────
0 │ 404.html │ File │ 429 B │ 3 days ago
1 │ CONTRIBUTING.md │ File │ 955 B │ 8 mins ago
2 │ Gemfile │ File │ 1.1 KB │ 3 days ago
3 │ Gemfile.lock │ File │ 6.9 KB │ 3 days ago
4 │ LICENSE │ File │ 1.1 KB │ 3 days ago
5 │ README.md │ File │ 213 B │ 3 days ago
────┬───────────────────────┬──────┬───────────┬─────────────╮
# │ name │ type │ size modified
────┼───────────────────────┼──────┼───────────┼─────────────┤
0 │ 404.html │ file 429 B │ 3 days ago
1 │ CONTRIBUTING.md │ file 955 B │ 8 mins ago
2 │ Gemfile │ file 1.1 KiB │ 3 days ago
3 │ Gemfile.lock │ file 6.9 KiB │ 3 days ago
4 │ LICENSE │ file 1.1 KiB │ 3 days ago
5 │ README.md │ file 213 B │ 3 days ago
...
18 changes: 9 additions & 9 deletions snippets/introduction/ls_sort_by_reverse_example.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
> ls | sort-by size | reverse
────┬────────────────────┬──────┬────────┬────────────
# │ name │ type │ size modified
────┼────────────────────┼──────┼────────┼────────────
0 │ Gemfile.lock │ File │ 6.9 KB │ 3 days ago
1 │ SUMMARY.md │ File │ 3.7 KB │ 3 days ago
2 │ Gemfile │ File │ 1.1 KB │ 3 days ago
3 │ LICENSE │ File │ 1.1 KB │ 3 days ago
4 │ CONTRIBUTING.md │ File │ 955 B │ 9 mins ago
5 │ books.md │ File │ 687 B │ 3 days ago
────┬───────────────────────┬──────┬───────────┬─────────────╮
# │ name │ type │ size modified
────┼───────────────────────┼──────┼───────────┼─────────────┤
0 │ Gemfile.lock │ file 6.9 KiB │ 3 days ago
1 │ SUMMARY.md │ file 3.7 KiB │ 3 days ago
2 │ Gemfile │ file 1.1 KiB │ 3 days ago
3 │ LICENSE │ file 1.1 KiB │ 3 days ago
4 │ CONTRIBUTING.md │ file 955 B │ 9 mins ago
5 │ books.md │ file 687 B │ 3 days ago
...
16 changes: 8 additions & 8 deletions snippets/introduction/ls_where_example.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
> ls | where size > 1kb
───┬──────────────┬──────┬────────┬────────────
# │ name │ type │ size │ modified
───┼──────────────┼──────┼────────┼────────────
0 │ Gemfile │ File │ 1.1 KB │ 3 days ago
1 │ Gemfile.lock │ File │ 6.9 KB │ 3 days ago
2 │ LICENSE │ File │ 1.1 KB │ 3 days ago
3 │ SUMMARY.md │ File │ 3.7 KB │ 3 days ago
───┴──────────────┴──────┴────────┴────────────
───┬───────────────────┬──────┬────────┬────────────
# │ name │ type │ size │ modified
───┼───────────────────┼──────┼────────┼────────────
0 │ Gemfile │ file │ 1.1 KiB │ 3 days ago
1 │ Gemfile.lock │ file │ 6.9 KiB │ 3 days ago
2 │ LICENSE │ file │ 1.1 KiB │ 3 days ago
3 │ SUMMARY.md │ file │ 3.7 KiB │ 3 days ago
───┴───────────────────┴──────┴────────┴────────────
15 changes: 8 additions & 7 deletions snippets/introduction/ps_example.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
> ps
─────┬───────┬──────────────────┬─────────┬─────────┬──────────┬─────────
# │ pid │ name │ status │ cpu │ mem │ virtual
─────┼───────┼──────────────────┼─────────┼─────────┼──────────┼─────────
0 │ 33155 │ nu_plugin_core_p │ Running │ 3.8496 │ 1.8 MB │ 4.4 GB
1 │ 32841 │ mdworker_shared │ Running │ 0.0000 │ 19.3 MB │ 4.4 GB
2 │ 32829 │ CoreServicesUIAg │ Running │ 0.0000 │ 16.1 MB │ 4.5 GB
3 │ 32828 │ mdworker_shared │ Running │ 0.0000 │ 23.0 MB │ 4.4 GB
╭─────┬──────┬──────────────────────┬─────────┬───────┬───────────┬──────────╮
│ # │ pid │ name │ status │ cpu │ mem │ virtual │
├─────┼──────┼──────────────────────┼─────────┼───────┼───────────┼──────────┤
│ 0 │ 7570 │ nu │ Running │ 1.96 │ 23.2 MiB │ 32.8 GiB │
│ 1 │ 3533 │ remindd │ Sleep │ 0.00 │ 103.6 MiB │ 32.3 GiB │
│ 2 │ 3495 │ TVCacheExtension │ Sleep │ 0.00 │ 11.9 MiB │ 32.2 GiB │
│ 3 │ 3490 │ MusicCacheExtension │ Sleep │ 0.00 │ 12.9 MiB │ 32.2 GiB │
...
12 changes: 6 additions & 6 deletions snippets/introduction/ps_where_example.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
> ps | where cpu > 5
───┬──────┬──────────────────┬─────────┬────────┬──────────┬─────────
# │ pid │ name │ status │ cpu │ mem │ virtual
───┼──────┼──────────────────┼─────────┼────────┼──────────┼─────────
0 │ 3971Google Chrome He │ Running │ 5.1263 99.4 MB 5.5 GB
1 │ 360iTerm2 │ Running │ 6.6635218.6 MB 6.0 GB
───┴──────┴──────────────────┴─────────┴────────┴──────────┴─────────
───┬──────┬────────────────┬─────────┬────────┬──────────┬──────────╮
# │ pid │ name │ status │ cpu mem │ virtual
───┼──────┼────────────────┼─────────┼────────┼──────────┼──────────┤
0 │ 1583Terminal │ Running │ 20.69127.8 MiB33.0 GiB │
1 │ 579photoanalysisd │ Running │ 139.50 99.9 MiB32.3 GiB │
───┴──────┴────────────────┴─────────┴────────┴──────────┴──────────╯
16 changes: 8 additions & 8 deletions snippets/introduction/sys_example.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
> sys
─────────┬─────────────────────────────────────────
host │ [row 7 columns]
cpu │ [row cores current ghz max ghz min ghz]
disks │ [table 2 rows]
mem │ [row free swap free swap total total]
net │ [table 11 rows]
battery │ [table 1 rows]
─────────┴─────────────────────────────────────────
───────┬───────────────────
host │ {record 6 fields} │
cpu │ [table 4 rows] │
disks │ [table 3 rows]
mem │ {record 4 fields} │
│ temp │ [table 1 row] │
│ net │ [table 4 rows]
───────┴───────────────────
17 changes: 8 additions & 9 deletions snippets/introduction/sys_get_example.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
> sys | get host
──────────┬─────────────────────────────────────────────
name │ Linux
release │ 5.3.0-1019-azure
version │ #20-Ubuntu SMP Fri Mar 27 23:54:23 UTC 2020
hostname │ lifeless
arch │ x86_64
uptime │ 8:03:47:32
sessions │ [table 2 rows]
──────────┴─────────────────────────────────────────────
╭────────────────┬────────────────────────╮
│ name │ Debian GNU/Linux │
│ os version │ 11 │
│ kernel version │ 5.10.92-v8+ │
│ hostname │ lifeless │
│ uptime │ 19day 21hr 34min 45sec │
│ sessions │ [table 1 row] │
╰────────────────┴────────────────────────╯
2 changes: 1 addition & 1 deletion snippets/introduction/sys_get_external_echo_example.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
> sys | get host.sessions.name | each { ^echo $it }
> sys | get host.sessions.name | each { |it| ^echo $it }
jt
6 changes: 3 additions & 3 deletions snippets/introduction/sys_get_nested_example.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> sys | get host.sessions.name
───┬────
0 │ jt
───┴────
───┬────
0 │ jt
───┴────