Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add filepath argument #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ Misc:
-dr, --dry-run Implies -v and doesn't actually changes either
wallpaper or background after the pokemon has been
chosen
-fp, --filepath Identical to --dry-run, but prints only the filepath
of the chosen image. Useful for scripting

Not setting any filters will get a completely random pokemon
```
Expand Down
6 changes: 6 additions & 0 deletions pokemonterminal/command_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@
help='Implies -v and doesn\'t actually changes either wallpaper '
'or background after the pokemon has been chosen',
action='store_true')
_misc_group.add_argument(
'-fp',
'--filepath',
help='Identical to --dry-run, but prints only the filepath of the chosen image. Useful for scripting',
action='store_true'
)
either = parser.add_mutually_exclusive_group()
either.add_argument(
'-c',
Expand Down
4 changes: 4 additions & 0 deletions pokemonterminal/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def main(argv=None):
print("Dry run, exiting.")
return

if options.filepath:
print(target.get_path())
return

event_name = "Pokemon-Terminal_Wallpaper" if options.wallpaper else "Pokemon-Terminal_Terminal"
event_exists = PlatformNamedEvent.exists(event_name)

Expand Down