Skip to content

Commit 1c503c2

Browse files
committed
fix: added missing line number to defintition command
1 parent ef90f64 commit 1c503c2

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

cli/src/command/definition.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,14 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) {
3737
println!("\n{}", "FlowType".bright_cyan().bold());
3838
match serde_json::to_string_pretty(flow_type) {
3939
Ok(json) => {
40+
let mut index = 0;
4041
for line in json.lines() {
41-
println!("{}", line.bright_green());
42+
index += 1;
43+
println!(
44+
"{} {}",
45+
format!("{index}:").bright_blue(),
46+
line.bright_green()
47+
);
4248
}
4349
}
4450
Err(_) => println!("{}", "Error serializing FlowType".red()),
@@ -57,8 +63,14 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) {
5763
println!("\n{}", "DataType".bright_cyan().bold());
5864
match serde_json::to_string_pretty(data_type) {
5965
Ok(json) => {
66+
let mut index = 0;
6067
for line in json.lines() {
61-
println!("{}", line.bright_green());
68+
index += 1;
69+
println!(
70+
"{} {}",
71+
format!("{index}:").bright_blue(),
72+
line.bright_green()
73+
);
6274
}
6375
}
6476
Err(_) => println!("{}", "Error serializing DataType".red()),

0 commit comments

Comments
 (0)