Add builtin -q

Used to query for a builtin's existence, like `type -q` and `functions
-q` can be used to query for a things and a functions existence respectively.
This commit is contained in:
Fabian Homborg
2019-02-09 12:34:00 +01:00
parent 3382a2145f
commit fb7a6e5f34
5 changed files with 42 additions and 3 deletions

View File

@@ -0,0 +1,2 @@
builtin: Invalid combination of options,
--query and --names are mutually exclusive

View File

@@ -0,0 +1,7 @@
# Tests for the "builtin" builtin/keyword.
builtin -q string; and echo String exists
builtin -q; and echo None exists
builtin -q string echo banana; and echo Some of these exist
builtin -nq string
echo $status
exit 0

View File

@@ -0,0 +1,3 @@
String exists
Some of these exist
2