Skip to content

Commit a35ba3b

Browse files
committed
show config path
1 parent 412f2cd commit a35ba3b

File tree

3 files changed

+701
-122
lines changed

3 files changed

+701
-122
lines changed

shellfirm/src/bin/cmd/config.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ pub fn run_severity(
306306
}
307307

308308
#[allow(clippy::unnecessary_wraps)]
309-
fn run_show(_config: &Config, settings: &Settings) -> Result<shellfirm::CmdExit> {
309+
fn run_show(config: &Config, settings: &Settings) -> Result<shellfirm::CmdExit> {
310310
let groups = if settings.includes.is_empty() {
311311
"(none)".to_string()
312312
} else {
@@ -341,8 +341,11 @@ fn run_show(_config: &Config, settings: &Settings) -> Result<shellfirm::CmdExit>
341341
|s| format!("{s}"),
342342
);
343343

344+
let config_path = config.setting_file_path.display();
345+
344346
let output = format!(
345347
"\
348+
Config path: {config_path}
346349
Challenge: {challenge}
347350
Active groups: {groups}
348351
Active checks: {active_checks}
@@ -352,6 +355,7 @@ Min severity: {min_severity}
352355
Audit: {audit}
353356
Protected branches: {protected_branches}
354357
Escalation: elevated={elevated}, critical={critical}",
358+
config_path = config_path,
355359
challenge = settings.challenge,
356360
audit = if settings.audit_enabled {
357361
"enabled"

shellfirm/src/bin/cmd/default.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pub fn command() -> Command {
44
Command::new("shellfirm")
55
.version(crate_version!())
66
.about("Protect yourself from risky shell commands with interactive challenges")
7+
.arg_required_else_help(true)
78
.arg(
89
Arg::new("log")
910
.long("log")

0 commit comments

Comments
 (0)