summaryrefslogtreecommitdiff
path: root/trip.rc
diff options
context:
space:
mode:
authorToby Goodwin <toby@paccrat.org>2018-03-17 18:36:15 +0000
committerToby Goodwin <toby@paccrat.org>2018-03-17 18:36:15 +0000
commit2dd0aa249c9bac4e5c616d1f386dc4271fdbab46 (patch)
tree973fff29c8728ec9a1bf7f53a8b613a214c5c809 /trip.rc
parent1128baa58acaff32e4538d5878b916fba091c574 (diff)
parent54ccf74c675696318b697182573a86668fe36f50 (diff)
Merge branch 'master' into ifnot
Diffstat (limited to 'trip.rc')
-rw-r--r--trip.rc8
1 files changed, 8 insertions, 0 deletions
diff --git a/trip.rc b/trip.rc
index 666418b..cc4ca0d 100644
--- a/trip.rc
+++ b/trip.rc
@@ -707,3 +707,11 @@ if (~ $status 0) {
# exercise "if not"
submatch 'if (false) echo foo; if not echo bar' 'bar' 'if not 1'
submatch 'if (false) echo foo; echo qux; if not echo bar' 'rc: `if not'' must follow `if''' 'if not 2'
+
+# exercise flag builtin
+submatch 'flag' 'rc: not enough arguments to flag' 'flag no args'
+submatch 'flag a b c' 'usage: flag f [ + | - ]' 'flag 3 args'
+submatch 'flag xx' 'usage: flag f [ + | - ]' 'flag wrong first arg'
+submatch 'flag x x' 'usage: flag f [ + | - ]' 'flag wrong second arg'
+submatch 'flag c && echo yes' yes 'flag c'
+submatch 'flag x +; flag x -' 'flag x -' 'setting x flag'