const='?',
                         default=None,
                         help='take shot history from a file')
    args = parser.parse_args()

    if args.visualizer_url:
        if args.visualizer_url == '?':
            tkinter.Tk()
            url = simpledialog.askstring(
                'shot URL', 'Enter URL of the shot: (https://...)\t\t\t\t\t')
        else:
            url = args.visualizer_url

        if not url.startswith('http://') and not url.startswith('https://'):
            raise RuntimeError('invalid shot url!')
        s = Shot.parse_visualizer(url)
        Analysis(s).show(True, args.verbose)
        exit(0)

    if args.file is None or args.file == '?':
        file_name = filedialog.askopenfilename()
    else:
        file_name = args.file
    with open(file_name, encoding='utf-8') as shot_file:
        ext = shot_file.name.split('.')[-1]
        if ext not in ['shot', 'json']:
            print('%s doesn\'t seem like a proper shot file.' % shot_file.name)
            exit(2)
        s = Shot.parse(shot_file)
        Analysis(s, args.verbose).show(True, args.verbose)