Skip to content

Commit

Permalink
fix(hok): Check if cat_style is empty
Browse files Browse the repository at this point in the history
addressing #10

Signed-off-by: Chawye Hsu <[email protected]>
  • Loading branch information
chawyehsu committed Jul 22, 2024
1 parent 71a7596 commit 4ed662e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/cmd/cat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,15 @@ pub fn cmd_cat(matches: &ArgMatches, session: &Session) -> Result<()> {
let cat_args = match cat == "bat.exe" {
false => vec![],
true => {
let mut args = vec!["--no-paging"];
let cat_style = config.cat_style();
vec!["--no-paging", "--style", cat_style, "--language", "json"]
if !cat_style.is_empty() {
args.push("--style");
args.push(cat_style);
}
args.push("--language");
args.push("json");
args
}
};

Expand Down

0 comments on commit 4ed662e

Please sign in to comment.