Skip to content

Commit ac249d0

Browse files
committed
cli.py: Add option to skip confirmation in check_in_my
Signed-off-by: Filip Gołaś <[email protected]>
1 parent f8f88fb commit ac249d0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

osfv_cli/src/osfv/cli/cli.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@ def check_in_my(snipeit_api, args):
101101
if not list_my_assets(snipeit_api, args):
102102
return
103103

104-
print(f"Are you sure you want to check in {len(my_assets)} assets? [y/N]")
105-
if input() != "y":
106-
print(f"Checking in {len(my_assets)} assets aborted.")
107-
return
104+
if not args.yes:
105+
print(f"Are you sure you want to check in {len(my_assets)} assets? [y/N]")
106+
if input() != "y":
107+
print(f"Checking in {len(my_assets)} assets aborted.")
108+
return
108109

109110
failed = []
110111
for asset in my_assets:
@@ -605,6 +606,9 @@ def main():
605606
check_in_my_parser = snipeit_subparsers.add_parser(
606607
"check_in_my", help="Check in all my used assets"
607608
)
609+
check_in_my_parser.add_argument(
610+
"-y", "--yes", action="store_true", help="Skips the confirmation"
611+
)
608612

609613
# RTE subcommands
610614
rte_parser.add_argument("--rte_ip", type=str, help="RTE IP address", required=True)

0 commit comments

Comments
 (0)