Merge pull request #790 from mfarberbrodsky/add-nth-docs

Add documentation for nth command
This commit is contained in:
Andrés N. Robalino 2019-10-04 16:24:06 -05:00 committed by GitHub
commit 8bb6bcb6eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

31
docs/commands/nth.md Normal file
View File

@ -0,0 +1,31 @@
# nth
This command returns the nth row of a table, starting from 0.
If the number given is less than 0 or more than the number of rows, nothing is returned.
## Usage
```shell
> [input-command] | nth [row-number]
```
## Examples
```shell
> ls
━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━
# │ name │ type │ readonly │ size │ accessed │ modified
───┼────────────┼───────────┼──────────┼────────┼───────────────┼───────────────
0 │ Cargo.toml │ File │ │ 239 B │ 2 minutes ago │ 2 minutes ago
1 │ .git │ Directory │ │ 4.1 KB │ 2 minutes ago │ 2 minutes ago
2 │ .gitignore │ File │ │ 19 B │ 2 minutes ago │ 2 minutes ago
3 │ src │ Directory │ │ 4.1 KB │ 2 minutes ago │ 2 minutes ago
━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━
> ls | nth 0
━━━━━━━━━━━━┯━━━━━━┯━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━
name │ type │ readonly │ size │ accessed │ modified
────────────┼──────┼──────────┼────────┼───────────────┼───────────────
Cargo.toml │ File │ │ 239 B │ 2 minutes ago │ 2 minutes ago
━━━━━━━━━━━━┷━━━━━━┷━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━
> ls | nth 5
```