From b1cbddfa76ec11052940dae477f017f8ea296a94 Mon Sep 17 00:00:00 2001 From: Yutaka Kurosaki Date: Sat, 31 Jan 2026 15:24:30 +0900 Subject: [PATCH] Fix: handle missing values for options like -s, -f, -o, -l, -d When options that require values (e.g., -s, -f) are followed by another flag (e.g., -s -c), the parser set them to boolean true instead of their expected string value, causing TypeError. Now these options properly fall back to defaults when no value is provided. Co-Authored-By: Claude Opus 4.5 --- bin/security-lint | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/security-lint b/bin/security-lint index 93b5f33..70efad9 100755 --- a/bin/security-lint +++ b/bin/security-lint @@ -611,17 +611,17 @@ HELP; $options = []; $format = $args['format'] ?? $args['f'] ?? null; - if ($format) { + if ($format !== null && $format !== true) { $options['format'] = $format; } $severity = $args['severity'] ?? $args['s'] ?? null; - if ($severity) { + if ($severity !== null && $severity !== true) { $options['severity'] = $severity; } $output = $args['output'] ?? $args['o'] ?? null; - if ($output) { + if ($output !== null && $output !== true) { $options['output'] = $output; } @@ -640,12 +640,12 @@ HELP; $options['include'] = $include; $depth = $args['recursive-depth'] ?? $args['d'] ?? null; - if ($depth) { + if ($depth !== null && $depth !== true) { $options['recursive-depth'] = $depth; } $lang = $args['lang'] ?? $args['l'] ?? null; - if ($lang) { + if ($lang !== null && $lang !== true) { $options['lang'] = $lang; }