Skip to content

Instantly share code, notes, and snippets.

@RicherMans
Created February 16, 2017 03:33
Show Gist options
  • Save RicherMans/831e95895167da8859fb9e1e7160aecf to your computer and use it in GitHub Desktop.
Save RicherMans/831e95895167da8859fb9e1e7160aecf to your computer and use it in GitHub Desktop.
Argparse sipplet sublime
<snippet>
<content><![CDATA[
import argparse
parser = argparse.ArgumentParser()
""" Arguments: ${1:arg} """
${1/(\A\s*,\s*\Z)|,?\s*([A-Za-z_][a-zA-Z0-9_]*)\s*(=[^,]*)?(,\s*|$)/(?2:parser.add_argument\('$2'\)\n)/g}
args = parser.parse_args()
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>argparse</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.python</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment