builtins: [: New command.

* gash/builtins (bracket-command): New function.
  (%builtin-commands): Add it.
This commit is contained in:
Jan Nieuwenhuizen 2018-07-14 23:14:25 +02:00
parent 4bb60cc4c3
commit 9623e014f0
1 changed files with 3 additions and 0 deletions

View File

@ -257,6 +257,8 @@ Options:
(help? (option-ref options 'help #f))
(version? (option-ref options 'version #f))
(files (option-ref options '() '()))
(files (if (equal? (last files) "]") (drop-right files 1)
files))
(file (and (pair? files) (car files))))
(cond (help? (display "Usage: test [EXPRESSION]
@ -549,4 +551,5 @@ Options:
("type" . ,type-command)
("wc" . ,wc-command)
("which" . ,which-command)
("[" . ,test-command)
))