feat: paging support for player list
This commit is contained in:
parent
c2b4c5a6bf
commit
bc02daae5f
24
Cargo.lock
generated
24
Cargo.lock
generated
|
@ -383,6 +383,17 @@ dependencies = [
|
|||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.2.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
|
||||
dependencies = [
|
||||
"errno-dragonfly",
|
||||
"libc",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.3.2"
|
||||
|
@ -883,6 +894,16 @@ dependencies = [
|
|||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pager"
|
||||
version = "0.16.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2599211a5c97fbbb1061d3dc751fa15f404927e4846e07c643287d6d1f462880"
|
||||
dependencies = [
|
||||
"errno 0.2.8",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "percent-encoding"
|
||||
version = "2.3.0"
|
||||
|
@ -1048,7 +1069,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "9bfe0f2582b4931a45d1fa608f8a8722e8b3c7ac54dd6d5f3b3212791fedef49"
|
||||
dependencies = [
|
||||
"bitflags 2.4.0",
|
||||
"errno",
|
||||
"errno 0.3.2",
|
||||
"libc",
|
||||
"linux-raw-sys",
|
||||
"windows-sys",
|
||||
|
@ -1212,6 +1233,7 @@ dependencies = [
|
|||
"cynic-codegen",
|
||||
"dirs",
|
||||
"itertools",
|
||||
"pager",
|
||||
"reqwest",
|
||||
"schema",
|
||||
"serde",
|
||||
|
|
|
@ -16,6 +16,7 @@ schema.path = "schema"
|
|||
# CLI
|
||||
clap = { version = "4.4", features = ["derive"] }
|
||||
chrono = "0.4"
|
||||
pager = "0.16"
|
||||
|
||||
# API access
|
||||
cynic = { version = "3.2", features = ["http-reqwest-blocking"] }
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use crate::database::*;
|
||||
use crate::queries::*;
|
||||
use crate::util::*;
|
||||
use pager::Pager;
|
||||
use sqlite::*;
|
||||
|
||||
fn player_display(
|
||||
|
@ -40,6 +41,8 @@ pub fn list(connection: &Connection, dataset: Option<String>, all: bool) {
|
|||
|
||||
players.sort_by_cached_key(|data| data.name.clone());
|
||||
|
||||
Pager::new().setup();
|
||||
|
||||
for player in players {
|
||||
player_display(player, true, false, true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue