1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-31 14:17:45 +00:00
nu_scripts/modules/after/after.nu
fj0r 140f556049
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>
2023-06-04 21:17:28 -05:00

21 lines
431 B
Text

def "nu-complete ps" [] {
ps -l | each {|x| { value: $"($x.pid)", description: $x.command } }
}
# 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
}