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)]
|
||||
{
|
||||
for column in [
|
||||
"name", "type", "target", "readonly", "mode", "uid", "group", "size", "created",
|
||||
"accessed", "modified",
|
||||
"name",
|
||||
"type",
|
||||
"target",
|
||||
"num_links",
|
||||
"readonly",
|
||||
"mode",
|
||||
"uid",
|
||||
"group",
|
||||
"size",
|
||||
"created",
|
||||
"accessed",
|
||||
"modified",
|
||||
]
|
||||
.iter()
|
||||
{
|
||||
@ -942,6 +952,9 @@ pub(crate) fn dir_entry_dict(
|
||||
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()) {
|
||||
dict.insert_untagged(
|
||||
"uid",
|
||||
|
@ -279,8 +279,18 @@ fn list_all_columns() {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
[
|
||||
"name", "type", "target", "readonly", "mode", "uid", "group", "size",
|
||||
"created", "accessed", "modified",
|
||||
"name",
|
||||
"type",
|
||||
"target",
|
||||
"num_links",
|
||||
"readonly",
|
||||
"mode",
|
||||
"uid",
|
||||
"group",
|
||||
"size",
|
||||
"created",
|
||||
"accessed",
|
||||
"modified",
|
||||
]
|
||||
.join("")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user