Skip to content

Commit

Permalink
v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mozillazg committed Jan 29, 2015
1 parent 006aab3 commit 5fdf409
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Changelog
--------------

0.1.0 (2015-01-29)
~~~~~~~~~~~~~~~~~~~~
* Initial Release
41 changes: 37 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,54 @@ python-shellwords

Parse line as shell words.

* Documentation: http://shellwords.rtfd.org

* GitHub: https://github.com/mozillazg/python-shellwords
* License: MIT license
* PyPI: https://pypi.python.org/pypi/shellwords
* Python version: 2.6, 2.7, pypy, 3.3, 3.4

Usage
-------


.. code-block:: python
>>> s = ShellWords()
>>> s.parse("./foo --bar=baz")
[u'./foo', u'--bar=baz']
.. code-block:: python
>>>
>>> os.environ['FOO'] = 'bar'
>>> s = ShellWords(parse_env=True)
>>> s.parse("./foo $FOO")
[u'./foo', u'bar']
.. code-block:: python
>>> s = ShellWords(parse_backtick=True)
>>> s.parse("./foo `echo $SHELL`")
[u'./foo', u'/bin/bash']
>>>
Thanks
-------

This is based on `go-shellwords`__ package.

__ https://github.com/mattn/go-shellwords


.. |Build| image:: https://api.travis-ci.org/mozillazg/python-shellwords.png?branch=master
:target: https://travis-ci.org/mozillazg/python-shellwords
.. |Coverage| image:: https://coveralls.io/repos/mozillazg/python-shellwords/badge.png?branch=master
:target: https://coveralls.io/r/mozillazg/python-shellwords
.. |PyPI version| image:: https://pypip.in/v/pyshellwords/badge.png
:target: https://crate.io/packages/pyshellwords
:target: https://crate.io/packages/shellwords
.. |PyPI downloads| image:: https://pypip.in/d/pyshellwords/badge.png
:target: https://crate.io/packages/pyshellwords
:target: https://crate.io/packages/shellwords
.. |Python 3| image:: https://caniusepython3.com/project/pyshellwords.svg
:target: https://caniusepython3.com/project/pyshellwords
:target: https://caniusepython3.com/project/shellwords
3 changes: 3 additions & 0 deletions shellwords/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Parse line as shell words."""

from __future__ import absolute_import, print_function, unicode_literals
import os
import re
Expand Down

0 comments on commit 5fdf409

Please sign in to comment.