diff options
| author | Toby Goodwin <toby@paccrat.org> | 2018-03-17 15:14:21 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2018-03-17 15:14:21 +0000 |
| commit | cccdab7ea2bb922413f02698ecc5969c00e7a7aa (patch) | |
| tree | 2d6291549e74bcf68fc7e46fc78be8ecd7cb8975 /trip.rc | |
| parent | 9c7ee8473a71303ab4cb51c9593089c07c224a22 (diff) | |
tidy up, test cases, document flag
Diffstat (limited to 'trip.rc')
| -rw-r--r-- | trip.rc | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -624,3 +624,11 @@ $rc -ec 'X=`{false}' if (~ $status 0) { fail '"rc -e" exits with zero status when backquote command returns non-zero' } + +# 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' |