nushell/nushell

Change columns flag of `update cells` into a rest argument

Aberta

#15.477 aberto em 2 de abr. de 2025

 (1 comentário) (0 reação) (0 responsável)Rust (2.129 forks)batch import
category:deprecationcategory:enhancementcategory:inconsistent-behaviorhelp wanted

Métricas do repositório

Stars
 (39.478 estrelas)
Métricas de merge de PR
 (Mesclagem média 4d 1h) (123 fundiu PRs em 30d)

Description

Related problem

Some commands (such as the into commands) can update specific cells if cell paths are specified after the command body. update cells has a similar behavior, but selects these cells with a --columns flag instead of rest arguments.

Describe the solution you'd like

Change columns flag of update cells into a rest argument. For example:

[[name val1 val2]; [foo 1 4] [bar 8 3]] | update cells -c [val1 val2] { $in * 2 }
# => ╭───┬──────┬──────┬──────╮
# => │ # │ name │ val1 │ val2 │
# => ├───┼──────┼──────┼──────┤
# => │ 0 │ foo  │    2 │    8 │
# => │ 1 │ bar  │   16 │    6 │
# => ╰───┴──────┴──────┴──────╯

is changed to:

[[name val1 val2]; [foo 1 4] [bar 8 3]] | update cells { $in * 2 } val1 val2
# => ╭───┬──────┬──────┬──────╮
# => │ # │ name │ val1 │ val2 │
# => ├───┼──────┼──────┼──────┤
# => │ 0 │ foo  │    2 │    8 │
# => │ 1 │ bar  │   16 │    6 │
# => ╰───┴──────┴──────┴──────╯

The --columns flag should be deprecated, and eventually removed.

Describe alternatives you've considered

No response

Additional context and details

No response

Guia do colaborador