Skip to content

Commit 1d5bb84

Browse files
committed
fix: token count display on non-json output
1 parent deb0d08 commit 1d5bb84

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,26 @@ fn main() -> Result<()> {
164164
.filter_map(|file| file.get("path").and_then(|p| p.as_str()).map(|s| s.to_string()))
165165
.collect();
166166

167+
let model_info = get_model_info(&args.encoding);
168+
167169
if args.json {
168170
let json_output = json!({
169171
"directory_name": label(&args.path),
170172
"token_count": token_count,
171-
"model_info": get_model_info(&args.encoding),
173+
"model_info": model_info,
172174
"files": paths,
173175
});
174176
println!("{}", serde_json::to_string_pretty(&json_output)?);
175177
return Ok(());
178+
} else {
179+
println!(
180+
"{}{}{} Token count: {}, Model info: {}",
181+
"[".bold().white(),
182+
"i".bold().blue(),
183+
"]".bold().white(),
184+
token_count.to_string().bold().yellow(),
185+
model_info
186+
);
176187
}
177188

178189
// Copy to Clipboard

0 commit comments

Comments
 (0)