From f97561c41654965efc9e2234ed40989abd1dc7e8 Mon Sep 17 00:00:00 2001 From: Chris Gillespie <6572184+gillespiecd@users.noreply.github.com> Date: Fri, 30 Oct 2020 10:39:01 -0700 Subject: [PATCH] Inode added to ls -l (#2711) --- crates/nu-cli/src/shell/filesystem_shell.rs | 4 ++++ crates/nu-cli/tests/commands/ls.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/crates/nu-cli/src/shell/filesystem_shell.rs b/crates/nu-cli/src/shell/filesystem_shell.rs index 2ee3bd492..e9036ff02 100644 --- a/crates/nu-cli/src/shell/filesystem_shell.rs +++ b/crates/nu-cli/src/shell/filesystem_shell.rs @@ -942,6 +942,7 @@ pub(crate) fn dir_entry_dict( "type", "target", "num_links", + "inode", "readonly", "mode", "uid", @@ -1019,6 +1020,9 @@ pub(crate) fn dir_entry_dict( let nlinks = md.nlink(); dict.insert_untagged("num_links", UntaggedValue::string(nlinks.to_string())); + let inode = md.ino(); + dict.insert_untagged("inode", UntaggedValue::string(inode.to_string())); + if let Some(user) = users::get_user_by_uid(md.uid()) { dict.insert_untagged( "uid", diff --git a/crates/nu-cli/tests/commands/ls.rs b/crates/nu-cli/tests/commands/ls.rs index 910224feb..bcd0d4c5a 100644 --- a/crates/nu-cli/tests/commands/ls.rs +++ b/crates/nu-cli/tests/commands/ls.rs @@ -298,6 +298,7 @@ fn list_all_columns() { "type", "target", "num_links", + "inode", "readonly", "mode", "uid",