diff options
| author | Kamil Essekkat <kamil@essekkat.pl> | 2014-06-09 11:41:47 +0200 |
|---|---|---|
| committer | Kamil Essekkat <kamil@essekkat.pl> | 2014-06-09 11:41:47 +0200 |
| commit | 8d024259a5a140777d2ed3a3a3a7089a8d0ba330 (patch) | |
| tree | 67525edd41d19269ae6177d1fa145ed5ed382ae2 /slugify | |
| parent | 52108c39d2a7c53def6bf55ddb0c81b185bb211a (diff) | |
| download | python-slugify-8d024259a5a140777d2ed3a3a3a7089a8d0ba330.tar.gz | |
Console entry point
Diffstat (limited to 'slugify')
| -rw-r--r-- | slugify/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/slugify/__init__.py b/slugify/__init__.py index 2905a88..0ff57f0 100644 --- a/slugify/__init__.py +++ b/slugify/__init__.py @@ -104,3 +104,11 @@ def slugify(text, entities=True, decimal=True, hexadecimal=True, max_length=0, w text = text.replace('-', separator) return text + + +def main(): + if len(sys.argv) < 2: + print "Usage %s TEXT TO SLUGIFY" % sys.argv[0] + return + text = ' '.join(sys.argv[1:]) + print slugify(text) |
