Skip to content

Commit 7a2deb3

Browse files
committed
changed file path parameter to positional parameter
1 parent aad23e1 commit 7a2deb3

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

cycode/cli/apps/report_import/sbom/sbom_command.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,17 @@
99
from cycode.cli.utils.sentry import add_breadcrumb
1010
from cycode.cyclient.import_sbom_client import ImportSbomParameters
1111

12-
_Input_RICH_HELP_PANEL = 'Input options'
13-
14-
1512
def sbom_command(
1613
ctx: typer.Context,
17-
input_file: Annotated[
14+
path: Annotated[
1815
Path,
19-
typer.Option(
20-
'--file',
21-
help='Path to an SBOM file.',
22-
show_default=False,
16+
typer.Argument(
17+
exists=True,
18+
resolve_path=True,
2319
dir_okay=False,
2420
readable=True,
25-
rich_help_panel=_Input_RICH_HELP_PANEL,
21+
help='Path to SBOM file.',
22+
show_default=False
2623
),
2724
],
2825
sbom_name: Annotated[
@@ -72,12 +69,12 @@ def sbom_command(
7269
)
7370

7471
try:
75-
if not input_file.exists():
72+
if not path.exists():
7673
from errno import ENOENT
7774
from os import strerror
7875

79-
raise FileNotFoundError(ENOENT, strerror(ENOENT), input_file.absolute())
76+
raise FileNotFoundError(ENOENT, strerror(ENOENT), path.absolute())
8077

81-
client.request_sbom_import_execution(import_parameters, input_file)
78+
client.request_sbom_import_execution(import_parameters, path)
8279
except Exception as e:
8380
handle_report_exception(ctx, e)

0 commit comments

Comments
 (0)