mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Add -i option to ls(1).
This commit is contained in:
parent
2194bdb8b9
commit
05a124467e
1 changed files with 6 additions and 0 deletions
|
@ -44,6 +44,7 @@ int current_year;
|
|||
#endif
|
||||
|
||||
bool directory = false;
|
||||
bool inode = false;
|
||||
bool longformat = false;
|
||||
bool showdotdot = false;
|
||||
bool showdotfiles = false;
|
||||
|
@ -130,6 +131,8 @@ int handleentry_internal(const char* fullpath, const char* name)
|
|||
const char* colorpre;
|
||||
const char* colorpost;
|
||||
getentrycolor(&colorpre, &colorpost, st.st_mode);
|
||||
if ( inode )
|
||||
printf("%ju ", (uintmax_t) st.st_ino);
|
||||
if ( !longformat )
|
||||
{
|
||||
printf("%s%s%s\n", colorpre, name, colorpost);
|
||||
|
@ -294,6 +297,9 @@ int main(int argc, char* argv[])
|
|||
case 'd':
|
||||
directory = true;
|
||||
break;
|
||||
case 'i':
|
||||
inode = true;
|
||||
break;
|
||||
case 'l':
|
||||
longformat = true;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue