summaryrefslogtreecommitdiffstats
path: root/src/commands/db.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-12-09 16:59:00 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-12-09 16:59:25 +0100
commit9956b75fff85529a022dcd6c8eebf3c57487dc3a (patch)
treebd7697722d950e23b713816156a695e613461091 /src/commands/db.rs
parentce2ef431eea7946c522b6660f50020ef511fc27b (diff)
Add support for script output styling in "db job" subcommand
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/commands/db.rs')
-rw-r--r--src/commands/db.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/commands/db.rs b/src/commands/db.rs
index 9aef86d..eb65425 100644
--- a/src/commands/db.rs
+++ b/src/commands/db.rs
@@ -284,7 +284,8 @@ fn jobs(conn_cfg: DbConnectionConfig, matches: &ArgMatches) -> Result<()> {
fn job(conn_cfg: DbConnectionConfig, config: &Configuration, matches: &ArgMatches) -> Result<()> {
- let highlighting_disabled = matches.is_present("script_disable_highlighting");
+ let script_highlight = !matches.is_present("no_script_highlight");
+ let script_line_numbers = !matches.is_present("no_script_line_numbers");
let configured_theme = config.script_highlight_theme();
let show_log = matches.is_present("show_log");
let show_script = matches.is_present("show_script");
@@ -386,7 +387,7 @@ fn job(conn_cfg: DbConnectionConfig, config: &Configuration, matches: &ArgMatche
log_len = format!("{:<4}", data.0.log_text.lines().count()).cyan(),
envs = env_vars.unwrap_or_else(|| String::from("<env vars hidden>")),
script_text = if show_script {
- crate::ui::script_to_printable(&data.0.script_text, !highlighting_disabled, configured_theme.as_ref(), false)?
+ crate::ui::script_to_printable(&data.0.script_text, script_highlight, configured_theme.as_ref(), script_line_numbers)?
} else {
String::from("<script hidden>")
},