2022-05-05 00:32:20 +05:30
|
|
|
"""Additional core utilities that are implemented in xonsh.
|
|
|
|
|
|
|
|
The current list includes:
|
2017-02-12 18:07:26 -05:00
|
|
|
|
|
|
|
* cat
|
|
|
|
* echo
|
|
|
|
* pwd
|
|
|
|
* tee
|
|
|
|
* tty
|
|
|
|
* yes
|
|
|
|
|
|
|
|
In many cases, these may have a lower performance overhead than the
|
|
|
|
posix command line utility with the same name. This is because these
|
|
|
|
tools avoid the need for a full subprocess call. Additionally, these
|
|
|
|
tools are cross-platform.
|
|
|
|
"""
|
2024-01-30 12:23:50 +01:00
|
|
|
|
2022-05-30 15:33:17 +05:30
|
|
|
from xonsh.built_ins import XonshSession
|
2022-01-08 13:58:46 +01:00
|
|
|
from xonsh.platform import ON_POSIX
|
2017-02-12 18:07:26 -05:00
|
|
|
from xonsh.xoreutils.cat import cat
|
|
|
|
from xonsh.xoreutils.echo import echo
|
|
|
|
from xonsh.xoreutils.pwd import pwd
|
|
|
|
from xonsh.xoreutils.tee import tee
|
|
|
|
from xonsh.xoreutils.tty import tty
|
2022-01-05 20:14:53 +05:30
|
|
|
from xonsh.xoreutils.umask import umask
|
2022-01-31 21:26:34 +05:30
|
|
|
from xonsh.xoreutils.uname import uname
|
2022-01-05 20:14:53 +05:30
|
|
|
from xonsh.xoreutils.uptime import uptime
|
2017-02-12 18:07:26 -05:00
|
|
|
from xonsh.xoreutils.yes import yes
|
|
|
|
|
|
|
|
|
2022-05-30 15:33:17 +05:30
|
|
|
def _load_xontrib_(xsh: XonshSession, **_):
|
|
|
|
xsh.aliases["cat"] = cat
|
|
|
|
xsh.aliases["echo"] = echo
|
|
|
|
xsh.aliases["pwd"] = pwd
|
|
|
|
xsh.aliases["tee"] = tee
|
|
|
|
xsh.aliases["tty"] = tty
|
|
|
|
xsh.aliases["uname"] = uname
|
|
|
|
xsh.aliases["uptime"] = uptime
|
|
|
|
xsh.aliases["umask"] = umask
|
|
|
|
xsh.aliases["yes"] = yes
|
|
|
|
if ON_POSIX:
|
|
|
|
from xonsh.xoreutils.ulimit import ulimit
|
2022-01-05 20:14:53 +05:30
|
|
|
|
2022-05-30 15:33:17 +05:30
|
|
|
xsh.aliases["ulimit"] = ulimit
|