From 0f4fa868be6d8b21b2a0a835720513c1f82adf56 Mon Sep 17 00:00:00 2001 From: Anthony Scopatz Date: Tue, 4 Aug 2015 22:24:25 -0500 Subject: [PATCH] Added DIRS rule to environ --- docs/tutorial.rst | 4 +++- xonsh/environ.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/tutorial.rst b/docs/tutorial.rst index e3ed5c008..4b15d883b 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -142,8 +142,10 @@ Like other variables in Python, environment variables have a type. Sometimes this type is imposed based on the variable name. The current rules are pretty simple: -* ``PATH``: any variable whose name contains PATH is a list of strings. +* ``\w*PATH``: any variable whose name ends in PATH is a list of strings. +* ``\w*DIRS``: any variable whose name ends in DIRS is a list of strings. * ``XONSH_HISTORY_SIZE``: this variable is an int. +* ``CASE_SENSITIVE_COMPLETIONS``: this variable is a boolean. xonsh will automatically convert back and forth to untyped (string-only) representations of the environment as needed (mostly by subprocess commands). diff --git a/xonsh/environ.py b/xonsh/environ.py index 8705327e5..5fbd0ffef 100644 --- a/xonsh/environ.py +++ b/xonsh/environ.py @@ -44,6 +44,7 @@ represent environment variable validation, conversion, detyping. DEFAULT_ENSURERS = { re.compile('\w*PATH'): (is_env_path, str_to_env_path, env_path_to_str), + re.compile('\w*DIRS'): (is_env_path, str_to_env_path, env_path_to_str), 'LC_CTYPE': (always_false, locale_convert('LC_CTYPE'), ensure_string), 'LC_MESSAGES': (always_false, locale_convert('LC_MESSAGES'), ensure_string), 'LC_COLLATE': (always_false, locale_convert('LC_COLLATE'), ensure_string),