mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 15:16:17 +02:00
Add ppid to ps command (#8750)
# Description Adds the `ppid` field that's available on all supported platforms to the `ps` command. This would be useful in my scripts. # User-Facing Changes - ps output now contains an extra column # Tests + Formatting Not sure if I need to add a test for this # After Submitting Update https://www.nushell.sh/book/quick_tour.html#quick-tour to show the new table
This commit is contained in:
@ -131,6 +131,11 @@ impl ProcessInfo {
|
||||
self.pid
|
||||
}
|
||||
|
||||
/// PPID of process
|
||||
pub fn ppid(&self) -> i32 {
|
||||
self.ppid
|
||||
}
|
||||
|
||||
/// Name of command
|
||||
pub fn name(&self) -> String {
|
||||
self.command()
|
||||
|
@ -302,6 +302,11 @@ impl ProcessInfo {
|
||||
self.pid
|
||||
}
|
||||
|
||||
/// Parent PID of process
|
||||
pub fn ppid(&self) -> i32 {
|
||||
self.ppid
|
||||
}
|
||||
|
||||
/// Name of command
|
||||
pub fn name(&self) -> String {
|
||||
if let Some(path) = &self.curr_path {
|
||||
|
@ -1006,6 +1006,11 @@ impl ProcessInfo {
|
||||
self.pid
|
||||
}
|
||||
|
||||
/// Parent PID of process
|
||||
pub fn ppid(&self) -> i32 {
|
||||
self.ppid
|
||||
}
|
||||
|
||||
/// Name of command
|
||||
pub fn name(&self) -> String {
|
||||
self.command.clone()
|
||||
|
Reference in New Issue
Block a user