From f68503fa2101e9f94a20336f7a05b5831186a50d Mon Sep 17 00:00:00 2001 From: Sebastian Jung Date: Sat, 30 Nov 2019 12:48:23 +0100 Subject: [PATCH] add documentation for get, ps --- docs/commands/get.md | 54 ++++++++++++++++++++++++++++++++++++++++++++ docs/commands/ps.md | 25 ++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 docs/commands/get.md create mode 100644 docs/commands/ps.md diff --git a/docs/commands/get.md b/docs/commands/get.md new file mode 100644 index 0000000000..5ab472130d --- /dev/null +++ b/docs/commands/get.md @@ -0,0 +1,54 @@ +# get + +Open given cells as text. + +Syntax: `get ...args` + +### Parameters: + +* `args`: optionally return additional data by path + +## Examples + +If we run `sys` we recieve a table which contains tables itself: + +```shell +> sys +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━ + host │ cpu │ disks │ mem │ temp │ net │ battery +────────────────────────────────────────┼────────────────────────────────────┼────────────────┼───────────────────────────────────────┼────────────────┼────────────────┼──────────────── + [row arch hostname name release uptime │ [row cores current ghz max ghz min │ [table 7 rows] │ [row free swap free swap total total] │ [table 6 rows] │ [table 3 rows] │ [table 1 rows] + users] │ ghz] │ │ │ │ │ +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━ +``` + +To access one of the embeded tables we can use the `get` command + +```shell +> sys | get cpu +━━━━━━━┯━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━ + cores │ current ghz │ min ghz │ max ghz +───────┼───────────────────┼────────────────────┼─────────────────── + 4 │ 1.530000000000000 │ 0.5000000000000000 │ 3.500000000000000 +━━━━━━━┷━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━ +``` +```shell +> sys | get battery +━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━ + vendor │ model │ mins to full +────────┼──────────┼────────────────── + SMP │ L14M2P21 │ 16.7024000000000 +━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━ +``` + +There's also the ability to pass multiple parameters to `get` which results in an output like this + +```shell +sys | get cpu battery +━━━┯━━━━━━━┯━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━ + # │ cores │ current ghz │ min ghz │ max ghz │ vendor │ model │ mins to full +───┼───────┼───────────────────┼────────────────────┼───────────────────┼────────┼──────────┼─────────────────── + 0 │ 4 │ 1.500000000000000 │ 0.5000000000000000 │ 3.500000000000000 │ │ │ + 1 │ │ │ │ │ SMP │ L14M2P21 │ 16.94503000000000 +━━━┷━━━━━━━┷━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━ +``` \ No newline at end of file diff --git a/docs/commands/ps.md b/docs/commands/ps.md new file mode 100644 index 0000000000..abf0b0714d --- /dev/null +++ b/docs/commands/ps.md @@ -0,0 +1,25 @@ +# ps + +This command shows information about system processes. + +Syntax: `ps` + +## Example + +```shell +> ps +... +━━━━┯━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━ + # │ pid │ name │ status │ cpu +────┼───────┼────────────────────────────────────────────────────────────────────┼─────────┼─────────────────── + 50 │ 10184 │ firefox.exe │ Running │ 0.000000000000000 + 51 │ 11584 │ WindowsTerminal.exe │ Running │ 0.000000000000000 + 52 │ 11052 │ conhost.exe │ Running │ 0.000000000000000 + 53 │ 7076 │ nu.exe │ Running │ 0.000000000000000 + ... + 66 │ 3000 │ Code.exe │ Running │ 0.000000000000000 + 67 │ 5388 │ conhost.exe │ Running │ 0.000000000000000 + 68 │ 6268 │ firefox.exe │ Running │ 0.000000000000000 + 69 │ 8972 │ nu_plugin_ps.exe │ Running │ 58.00986000000000 +━━━━┷━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━ +``` \ No newline at end of file