mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-07-31 14:17:45 +00:00

- 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>
21 lines
431 B
Text
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
|
|
}
|