Files
regorus/scripts/rego-lex
Anand Krishnamoorthi cb0b3a1790 Code from github.com/anakrish/rego-rs
Authored by anakrish and mingweishih

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2023-02-09 10:56:54 -08:00

28 lines
416 B
Bash
Executable File

#!/bin/bash
# Copyright (c) Rego-Rs Authors.
# Licensed under the Apache 2.0 license.
set -e
usage="usage: rego-lex <policy.rego> [-v]"
if [ -z "$1" ]; then
echo "$usage"
exit 1
fi
rego=$(realpath -e $1)
case "$2" in
"-v")
verbose="verbose"
;;
*)
if [ ! -z "$2" ]; then
echo "$usage"
exit 1
fi
esac
eval "cargo test lexer::one_file -- --include-ignored --nocapture $rego $verbose"