Fixes #1204 : sys | get host.users displays the same user (#1480)

account twice while only one exists (macOS)

- renamed host.users to host.sessions
This commit is contained in:
Kyle Criddle 2020-03-11 19:01:55 -06:00 committed by GitHub
parent 3afb53b8ce
commit 5b0b2f1ddd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -113,7 +113,8 @@ async fn host(tag: Tag) -> Value {
dict.insert_value("uptime", uptime_dict);
}
// Users
// Sessions
// note: the heim host module has nomenclature "users"
let mut users = host::users();
let mut user_vec = vec![];
while let Some(user) = users.next().await {
@ -125,7 +126,7 @@ async fn host(tag: Tag) -> Value {
}
}
let user_list = UntaggedValue::Table(user_vec);
dict.insert_untagged("users", user_list);
dict.insert_untagged("sessions", user_list);
dict.into_value()
}

View File

@ -1,6 +1,6 @@
# sys
This command gives information about the system where nu is running on.
This command gives information about the system nu is running on.
## Examples
@ -13,7 +13,7 @@ This command gives information about the system where nu is running on.
━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━
> sys | get host
━━━━━━━━┯━━━━━━━━━┯━━━━━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━
name │ release │ hostname │ arch │ uptime │ users
name │ release │ hostname │ arch │ uptime │ sessions
────────┼─────────┼──────────────┼────────┼────────────────┼──────────────────
Darwin │ 18.7.0 │ C02Y437GJGH6 │ x86_64 │ [table: 1 row] │ [table: 17 rows]
━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━
@ -29,4 +29,4 @@ This command gives information about the system where nu is running on.
─────────┼──────────┼────────────┼───────────
34.4 GB │ 545.0 MB │ 2.1 GB │ 723.0 MB
━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━
```
```