Skip to content

Commit

Permalink
cli: make solana validators line numbering respect sort reversal
Browse files Browse the repository at this point in the history
  • Loading branch information
t-nelson committed Jun 30, 2022
1 parent d053ce7 commit f93fd64
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cli-output/src/cli_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,12 @@ impl fmt::Display for CliValidators {

for (i, validator) in sorted_validators.iter().enumerate() {
if padding > 0 {
write!(f, "{:padding$}", i + 1, padding = padding)?;
let num = if self.validators_reverse_sort {
i + 1
} else {
sorted_validators.len() - i
};
write!(f, "{:padding$} ", num, padding = padding)?;
}
write_vote_account(
f,
Expand Down

0 comments on commit f93fd64

Please sign in to comment.