change to return self, add docs and CL

This commit is contained in:
Gil Forsyth 2016-03-31 16:56:39 -04:00
parent 948dd832b5
commit 29b978b35c
3 changed files with 10 additions and 1 deletions

View file

@ -12,6 +12,7 @@ Current Developments
* Automatically enhance colors for readability in the default terminal (cmd.exe)
on Windows. This functionality can be enabled/disabled with the
$INTENSIFY_COLORS_ON_WIN environment variable.
* Added ``Ellipsis`` lookup to ``__xonsh_env__`` to allow environment variable checks, e.g. ``'HOME' in ${...}``
**Changed:**

View file

@ -197,6 +197,14 @@ examples in action:
Not bad, xonsh, not bad.
If you want to check if an environment variable is present in your current
session (say, in your awesome new ``xonsh`` script) you can pass an Ellipsis to
the ``${}`` operator:
.. code-block:: xonshcon
>>> 'HOME' in ${...}
True
Running Commands
==============================

View file

@ -587,7 +587,7 @@ class Env(MutableMapping):
def __getitem__(self, key):
if key is Ellipsis:
val = builtins.__xonsh_env__
return val
return self
m = self._arg_regex.match(key)
if (m is not None) and (key not in self._d) and ('ARGS' in self._d):
args = self._d['ARGS']