Skip to content

Commit 2ed9557

Browse files
committed
[cli] Add --accept-path flag to automatically use computed save path
1 parent da23690 commit 2ed9557

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

legendary/cli.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ def sync_saves(self, args):
474474

475475
# if there is no saved save path, try to get one
476476
if not igame.save_path:
477-
if args.yes:
477+
if args.yes and not args.accept_path:
478478
logger.info('Save path for this title has not been set, skipping due to --yes')
479479
continue
480480

@@ -486,6 +486,11 @@ def sync_saves(self, args):
486486
if '%' in save_path or '{' in save_path:
487487
logger.warning('Path contains unprocessed variables, please enter the correct path manually.')
488488
yn = False
489+
# When accept_path is set we don't want to fall back to interactive mode
490+
if args.accept_path:
491+
continue
492+
elif args.accept_path:
493+
yn = True
489494
else:
490495
yn = get_boolean_choice('Is this correct?')
491496

@@ -2805,6 +2810,8 @@ def main():
28052810
help='Override savegame path (requires single app name to be specified)')
28062811
sync_saves_parser.add_argument('--disable-filters', dest='disable_filters', action='store_true',
28072812
help='Disable save game file filtering')
2813+
sync_saves_parser.add_argument('--accept-path', dest='accept_path', action='store_true',
2814+
help=argparse.SUPPRESS)
28082815

28092816
clean_saves_parser.add_argument('--delete-incomplete', dest='delete_incomplete', action='store_true',
28102817
help='Delete incomplete save files')

0 commit comments

Comments
 (0)