mirror of
https://github.com/nushell/nushell.git
synced 2025-02-02 11:39:55 +01:00
Num links added to ls -l output (#2496)
This commit is contained in:
parent
79cc725aff
commit
5a725f9651
@ -874,8 +874,18 @@ pub(crate) fn dir_entry_dict(
|
|||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
{
|
{
|
||||||
for column in [
|
for column in [
|
||||||
"name", "type", "target", "readonly", "mode", "uid", "group", "size", "created",
|
"name",
|
||||||
"accessed", "modified",
|
"type",
|
||||||
|
"target",
|
||||||
|
"num_links",
|
||||||
|
"readonly",
|
||||||
|
"mode",
|
||||||
|
"uid",
|
||||||
|
"group",
|
||||||
|
"size",
|
||||||
|
"created",
|
||||||
|
"accessed",
|
||||||
|
"modified",
|
||||||
]
|
]
|
||||||
.iter()
|
.iter()
|
||||||
{
|
{
|
||||||
@ -942,6 +952,9 @@ pub(crate) fn dir_entry_dict(
|
|||||||
UntaggedValue::string(umask::Mode::from(mode).to_string()),
|
UntaggedValue::string(umask::Mode::from(mode).to_string()),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let nlinks = md.nlink();
|
||||||
|
dict.insert_untagged("num_links", UntaggedValue::string(nlinks.to_string()));
|
||||||
|
|
||||||
if let Some(user) = users::get_user_by_uid(md.uid()) {
|
if let Some(user) = users::get_user_by_uid(md.uid()) {
|
||||||
dict.insert_untagged(
|
dict.insert_untagged(
|
||||||
"uid",
|
"uid",
|
||||||
|
@ -279,8 +279,18 @@ fn list_all_columns() {
|
|||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
{
|
{
|
||||||
[
|
[
|
||||||
"name", "type", "target", "readonly", "mode", "uid", "group", "size",
|
"name",
|
||||||
"created", "accessed", "modified",
|
"type",
|
||||||
|
"target",
|
||||||
|
"num_links",
|
||||||
|
"readonly",
|
||||||
|
"mode",
|
||||||
|
"uid",
|
||||||
|
"group",
|
||||||
|
"size",
|
||||||
|
"created",
|
||||||
|
"accessed",
|
||||||
|
"modified",
|
||||||
]
|
]
|
||||||
.join("")
|
.join("")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user