cat
/
012
/
clone
ssh
copy
https
copy
a spreadsheet for the terminal: lotus 1-2-3 looks, google sheets keys and formulas, one go binary
code
commits
branches
reviews
sites
releases
insights
main
all branches
012
/
internal
/
nushell
/
testdata
/
ide
/
hover-sort-by.json
history
hover-sort-by.json
1.3K
blame
history
wrap lines
copy
1
{
"hover"
:
"Sort by the given cell path or closure.\n### Usage\n```\n sort-by {flags} <...comparator>\n```\n\n### Flags\n\n `-h`, `--help` - Display the help message for this command\\\n `-r`, `--reverse` - Sort in reverse order.\\\n `-i`, `--ignore-case` - Sort string-based data case-insensitively.\\\n `-n`, `--natural` - Sort alphanumeric string-based data naturally (1, 9, 10, 99, 100, ...).\\\n `-c`, `--custom` - Use closures to specify a custom sort order, rather than to compute a comparison key.\n\n### Parameters\n\n `...comparator: oneof<cell-path, closure>` - The cell path(s) or closure(s) to compare elements by.\n\n\n### Input/output types\n\n```\n list<any> | list<any>\n record | table\n table | table\n\n```\n### Example(s)\n```\n```\n Sort files by modified date.\n```\n ls | sort-by modified\n\n```\n Sort files by name (case-insensitive).\n```\n ls | sort-by name --ignore-case\n\n```\n Sort a table by a column (reversed order).\n```\n [[fruit count]; [apple 9] [pear 3] [orange 7]] | sort-by fruit --reverse\n\n```\n Sort by a nested value.\n```\n [[name info]; [Cairo {founded: 969}] [Kyoto {founded: 794}]] | sort-by info.founded\n\n```\n Sort by the last value in a list.\n```\n [[2 50] [10 1]] | sort-by { last }\n\n```\n Sort in a custom order.\n```\n [7 3 2 8 4] | sort-by -c {|a, b| $a < $b}\n\n"
,
"span"
:
{
"start"
:
16
,
"end"
:
23
}
}