1
Fork 0
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:
fj0r 2023-06-05 10:17:28 +08:00 committed by GitHub
parent b92eb7c03f
commit 140f556049
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 190 additions and 42 deletions

View file

@ -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
}