mirror of
https://github.com/nushell/nushell.git
synced 2025-07-09 19:07:16 +02:00
## ✅ Improve `drop nth` command to support spreadable arguments ### Summary This PR updates the `drop nth` command to support **spreadable arguments** in a way consistent with other commands like `which`, enabling: ```nu [1 2 3 4 5] | drop nth 0 2 4 ``` ### What's Changed * **Previously**: only a single index or a single range was accepted as the first argument, with rest arguments ignored for ranges. * **Now**: the command accepts any combination of: * Integers: to drop individual rows * Ranges: to drop slices of rows * Unbounded ranges: like `3..`, to drop from index onward Example: ```nu [one two three four five six] | drop nth 0 2 4..5 # drops "one", "three", "five", and "six" ``` ### Test Manual Test:  ### Notes As per feedback: * We **only collect the list of indices** to drop, not the input stream. * Unbounded ranges are handled by terminating the stream early. Let me know if you'd like further changes --------- Co-authored-by: Kumar Ujjawal <kumar.ujjawal@greenpista.com> Co-authored-by: Kumar Ujjawal <kumarujjawal@Kumars-MacBook-Air.local>