diff --git a/lib/mix/tasks/prom_ex.dashboard.export.ex b/lib/mix/tasks/prom_ex.dashboard.export.ex index 774e6f3a..7ea0c38f 100644 --- a/lib/mix/tasks/prom_ex.dashboard.export.ex +++ b/lib/mix/tasks/prom_ex.dashboard.export.ex @@ -13,7 +13,7 @@ defmodule Mix.Tasks.PromEx.Dashboard.Export do This is needed to fetch any relevant assigns from the `c:PromEx.dashboard_assigns/0` callback - -s, --std_out A boolean flag denoting that the rendered dashboard should be output + -s, --stdout A boolean flag denoting that the rendered dashboard should be output to STDOUT. -f, --file_path If you would like the write the generated JSON dashboard definition diff --git a/test/mix/tasks/prom_ex.dashboard.export_test.exs b/test/mix/tasks/prom_ex.dashboard.export_test.exs index 47b7971d..2c3cc372 100644 --- a/test/mix/tasks/prom_ex.dashboard.export_test.exs +++ b/test/mix/tasks/prom_ex.dashboard.export_test.exs @@ -104,6 +104,19 @@ defmodule Mix.Tasks.PromEx.Dashboard.ExportTest do assert output =~ ~s("datasource": "an_id") end + test "outputs to STDOUT if the --stdout flag is present", ctx do + output = + capture_io(fn -> + File.cd!(ctx.tmp_dir, fn -> + Config.run(~w(-d an_id -o sample)) + Code.compile_file("lib/sample/prom_ex.ex") + Export.run(~w(-m Sample.PromEx -d phoenix.json --stdout)) + end) + end) + + assert output =~ ~s("datasource": "an_id") + end + test "outputs to STDOUT if the -s flag is present and there is an assign override", ctx do output = capture_io(fn ->