Commits

Rolando Espinoza  committed 8f4298e

added syntax option

  • Participants
  • Parent commits 80a1475

Comments (0)

Files changed (1)

 
 
 def _paste_dpaste(content, **parameters):
-    data = {'content': content, 'language': 'Diff'}
+    data = {'content': content, 'language': parameters['syntax'] or 'Diff'}
     if parameters['title']:
         data['title'] = parameters['title']
     if parameters['user']:
     return response.geturl()
 
 def _paste_dpaste_org(content, **parameters):
-    data = {'content': content, 'lexer': 'diff'}
+    data = {'content': content, 'lexer': parameters['syntax'] or 'diff'}
     if parameters['title']:
         data['title'] = parameters['title']
     if parameters['user']:
         ('',  'httpauth', '', 'http authorization (user:pass)'),
         ('',  'usenetrc', False, 'use ~/.netrc for http authorization'),
         ('',  'stdin', False, 'read content from standard input'),
+        ('',  'syntax', '', 'choose syntax'),
     ] + commands.diffopts + commands.walkopts,
     'hg paste [OPTION] [-r REV] [FILE...]')
 }