Skip to content

Commit 5b9467c

Browse files
committed
Correct path for disks on NVMe disks
Fixes #10
1 parent f479cad commit 5b9467c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "gptman"
3-
version = "0.6.0"
3+
version = "0.6.1"
44
authors = ["Cecile Tonglet <[email protected]>"]
55
license = "MIT"
66
edition = "2018"

src/cli/commands.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,14 @@ pub fn print(opt: &Opt, path: &PathBuf, gpt: &GPT, len: u64) -> Result<()> {
436436
Column::Name => table.add_cell("Name"),
437437
}
438438
}
439+
let mut base_path = path.display().to_string();
440+
if base_path.ends_with(char::is_numeric) {
441+
base_path += "p";
442+
}
439443
for (i, p) in gpt.iter().filter(|(_, x)| x.is_used()) {
440444
for column in opt.columns.iter() {
441445
match column {
442-
Column::Device => table.add_cell(&format!("{}{}", path.display(), i)),
446+
Column::Device => table.add_cell(&format!("{}{}", base_path, i)),
443447
Column::Start => table.add_cell_rtl(&format!("{}", p.starting_lba)),
444448
Column::End => table.add_cell_rtl(&format!("{}", p.ending_lba)),
445449
Column::Sectors => table.add_cell_rtl(&format!("{}", p.size()?)),

0 commit comments

Comments
 (0)