Skip to content

Commit 7463926

Browse files
Fixed issue where validation returned list instead of single value
1 parent be98578 commit 7463926

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

cycode/cli/apps/scan/scan_command.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
_SECRET_RICH_HELP_PANEL = 'Secret options'
2929

3030

31-
def _single_value_callback(ctx: typer.Context, param: typer.CallbackParam, value: tuple) -> Any:
31+
def _single_value_callback(ctx: typer.Context, param: typer.CallbackParam, value: list) -> list:
3232
if len(value) > 1:
3333
values_str = ', '.join(str(v) for v in value)
3434
param_hint = '/'.join(sorted(param.opts, key=len))
@@ -39,7 +39,7 @@ def _single_value_callback(ctx: typer.Context, param: typer.CallbackParam, value
3939
)
4040
err.exit_code = 1
4141
raise err
42-
return value[0]
42+
return value
4343

4444

4545
def scan_command(
@@ -152,6 +152,9 @@ def scan_command(
152152
param_hint='--export-file',
153153
)
154154

155+
# _single_value_callback validated exactly one value was provided; unwrap from list
156+
scan_type = scan_type[0]
157+
155158
ctx.obj['show_secret'] = show_secret
156159
ctx.obj['soft_fail'] = soft_fail
157160
ctx.obj['stop_on_error'] = stop_on_error

0 commit comments

Comments
 (0)