From a90187a06b72d65b964491ceeacaebbef9271c61 Mon Sep 17 00:00:00 2001 From: Torin Sandall Date: Thu, 16 Apr 2020 08:22:03 -0400 Subject: [PATCH] cmd/test: Deprecate -l flag to show line numbers This flag and the underlying logic to report the line number is not needed anymore. We have a better solution with the location info on the pretty tracer. Signed-off-by: Torin Sandall --- cmd/test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/test.go b/cmd/test.go index 67736889fa..fd1a016190 100644 --- a/cmd/test.go +++ b/cmd/test.go @@ -70,7 +70,7 @@ If the '--bundle' option is specified the paths will be treated as policy bundle and loaded following standard bundle conventions. The path can be a compressed archive file or a directory which will be treated as a bundle. Without the '--bundle' flag OPA will recursively load ALL *.rego, *.json, and *.yaml files for evaluating the test cases. - + Example policy (example/authz.rego): package authz @@ -329,6 +329,7 @@ func filterTrace(params *testCommandParams, trace []*topdown.Event) []*topdown.E func init() { testCommand.Flags().BoolVarP(&testParams.verbose, "verbose", "v", false, "set verbose reporting mode") testCommand.Flags().BoolVarP(&testParams.failureLine, "show-failure-line", "l", false, "show test failure line") + testCommand.Flags().MarkDeprecated("show-failure-line", "use -v instead") testCommand.Flags().DurationVarP(&testParams.timeout, "timeout", "t", time.Second*5, "set test timeout") testCommand.Flags().VarP(testParams.outputFormat, "format", "f", "set output format") testCommand.Flags().BoolVarP(&testParams.coverage, "coverage", "c", false, "report coverage (overrides debug tracing)")