diff --git a/spotify-backup.py b/spotify-backup.py index 5cf672f..406b63e 100644 --- a/spotify-backup.py +++ b/spotify-backup.py @@ -115,9 +115,14 @@ def main(): parser.add_argument('--token', metavar='OAUTH_TOKEN', help='use a Spotify OAuth token (requires the ' + '`playlist-read-private` permission)') parser.add_argument('--format', default='txt', choices=['json', 'txt'], help='output format (default: txt)') - parser.add_argument('file', help='output filename') + parser.add_argument('file', help='output filename', nargs='?') args = parser.parse_args() + # If they didn't give a filename, then just prompt them. (They probably just double-clicked.) + if not args.file: + print "Enter a file name (e.g. playlists.txt):", + args.file = raw_input() + # Log into the Spotify API. if args.token: spotify = SpotifyAPI(args.token)