Skip to content

Commit 68186a3

Browse files
authored
Merge pull request #2 from kkpan11/PR_add_filepath_argument
add filepath argument
2 parents ed8f7f4 + 152d0f1 commit 68186a3

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ Misc:
148148
-dr, --dry-run Implies -v and doesn't actually changes either
149149
wallpaper or background after the pokemon has been
150150
chosen
151+
-fp, --filepath Identical to --dry-run, but prints only the filepath
152+
of the chosen image. Useful for scripting
151153
152154
Not setting any filters will get a completely random pokemon
153155
```

pokemonterminal/command_flags.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@
9595
help='Implies -v and doesn\'t actually changes either wallpaper '
9696
'or background after the pokemon has been chosen',
9797
action='store_true')
98+
_misc_group.add_argument(
99+
'-fp',
100+
'--filepath',
101+
help='Identical to --dry-run, but prints only the filepath of the chosen image. Useful for scripting',
102+
action='store_true'
103+
)
98104
either = parser.add_mutually_exclusive_group()
99105
either.add_argument(
100106
'-c',

pokemonterminal/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ def main(argv=None):
6969
print("Dry run, exiting.")
7070
return
7171

72+
if options.filepath:
73+
print(target.get_path())
74+
return
75+
7276
event_name = "Pokemon-Terminal_Wallpaper" if options.wallpaper else "Pokemon-Terminal_Terminal"
7377
event_exists = PlatformNamedEvent.exists(event_name)
7478

0 commit comments

Comments
 (0)