Enable xonsh-cat for invocation directly from OS shell.

This commit is contained in:
Bob Hyman 2020-08-08 02:33:07 -04:00
parent f321ebf041
commit 91f1962d28
3 changed files with 4 additions and 2 deletions

View file

@ -21,6 +21,8 @@
When multiple interpreters are in PATH, 'py' will choose the first one (usually in the virtual environment),
but 'py -3' finds the system-wide one, apparently by design.
* For xonsh-cat, avoid parsing and processing first (0'th) argument when invoked directly from OS shell.
**Security:**

View file

@ -379,7 +379,7 @@ def main():
"pytest11": ["xonsh = xonsh.pytest_plugin"],
"console_scripts": [
"xonsh = xonsh.main:main",
"xonsh-cat = xonsh.xorutils.cat",
"xonsh-cat = xonsh.xoreutils.cat:cat_main",
],
}
skw["cmdclass"]["develop"] = xdevelop

View file

@ -161,7 +161,7 @@ def cat_main(args=None):
from xonsh.main import setup
setup()
args = sys.argv if args is None else args
args = sys.argv[1:] if args is None else args
cat(args, sys.stdin, sys.stdout, sys.stderr)