mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
more precise parsing of cmd through the information in nu.scope.commands
(#522)
- refactor `after` to `after`, `before` - `gp` support `back-to-prev` for merging scenes - `ka`, `ke`, `kep`, `ked`, `kes` supports labels selector Co-authored-by: agent <agent@nuc>
This commit is contained in:
parent
b92eb7c03f
commit
140f556049
4 changed files with 190 additions and 42 deletions
|
@ -2,8 +2,20 @@ def "nu-complete ps" [] {
|
|||
ps -l | each {|x| { value: $"($x.pid)", description: $x.command } }
|
||||
}
|
||||
|
||||
# after { do something ... } <pid>
|
||||
export def main [action, pid: string@"nu-complete ps"] {
|
||||
# after <pid> {|| do something ... }
|
||||
export def main [
|
||||
pid: string@"nu-complete ps"
|
||||
action
|
||||
] {
|
||||
do -i { tail --pid $pid -f /dev/null }
|
||||
do $action
|
||||
}
|
||||
|
||||
# before {|| do something ... } <pid>
|
||||
export def before [
|
||||
action
|
||||
pid: string@"nu-complete ps"
|
||||
] {
|
||||
do -i { tail --pid $pid -f /dev/null }
|
||||
do $action
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue