Commits

Georg Brandl committed ae28bcc

Add -b option to open URL in browser, contributed by Brett Carter.

Comments (0)

Files changed (1)

         ui.status(url + '\n')
         if not opts['nocopy']:
             copy_to_clipboard(url)
+        if opts['browser']:
+            import webbrowser
+            webbrowser.open(url)
 
 cmdtable = {
     '^paste': (
         paste,
         commands.table['^diff'][1] + [
+            ('b', 'browser', None, 'open url in web browser'),
             ('n', 'nocopy', None, 'do not copy to clipboard'),
             ('', 'private', None, 'create a private paste'),
         ],