mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Change f
/full
flag to l
/long
for ls
and ps
commands (#2283)
* Change `f`/`full` flag to `l`/`long` for `ls` and `ps` commands * Fix a few more `--full` instances
This commit is contained in:
@ -10,15 +10,15 @@ impl Plugin for Ps {
|
||||
Ok(Signature::build("ps")
|
||||
.desc("View information about system processes.")
|
||||
.switch(
|
||||
"full",
|
||||
"long",
|
||||
"list all available columns for each entry",
|
||||
Some('f'),
|
||||
Some('l'),
|
||||
)
|
||||
.filter())
|
||||
}
|
||||
|
||||
fn begin_filter(&mut self, callinfo: CallInfo) -> Result<Vec<ReturnValue>, ShellError> {
|
||||
Ok(block_on(ps(callinfo.name_tag, callinfo.args.has("full")))?
|
||||
Ok(block_on(ps(callinfo.name_tag, callinfo.args.has("long")))?
|
||||
.into_iter()
|
||||
.map(ReturnSuccess::value)
|
||||
.collect())
|
||||
|
@ -28,7 +28,7 @@ async fn usage(process: Process) -> ProcessResult<(process::Process, Ratio, proc
|
||||
Ok((process, usage_2 - usage_1, memory))
|
||||
}
|
||||
|
||||
pub async fn ps(tag: Tag, full: bool) -> Result<Vec<Value>, ShellError> {
|
||||
pub async fn ps(tag: Tag, long: bool) -> Result<Vec<Value>, ShellError> {
|
||||
let processes = process::processes()
|
||||
.await
|
||||
.map_err(|_| {
|
||||
@ -67,7 +67,7 @@ pub async fn ps(tag: Tag, full: bool) -> Result<Vec<Value>, ShellError> {
|
||||
"virtual",
|
||||
UntaggedValue::filesize(memory.vms().get::<information::byte>()),
|
||||
);
|
||||
if full {
|
||||
if long {
|
||||
if let Ok(parent_pid) = process.parent_pid().await {
|
||||
dict.insert_untagged("parent", UntaggedValue::int(parent_pid))
|
||||
}
|
||||
|
Reference in New Issue
Block a user