mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 22:57:46 +00:00

Deprecates the existing `stdlib-candidate` directories in `nu_scripts` since `std-rfc` has now transitioned to the main repo. Updates readme and renamed directories.
14 lines
385 B
Text
14 lines
385 B
Text
# Assign keynames to a list of values, effectively converting the list to a record.
|
|
#
|
|
# Example:
|
|
#
|
|
# [ 1 2 3 ] | name-values a b c
|
|
# => ╭───┬───╮
|
|
# => │ a │ 1 │
|
|
# => │ b │ 2 │
|
|
# => │ c │ 3 │
|
|
# => ╰───┴───╯
|
|
export def main [...names: string]: [list -> record] {
|
|
let IN = $in
|
|
0.. | zip $IN | into record | rename ...$names
|
|
}
|