From 9c7238db50c485cd03b7c21928bc2381e394f027 Mon Sep 17 00:00:00 2001 From: Joseph Kato Date: Thu, 15 Feb 2024 21:10:15 -0800 Subject: [PATCH] feat: add `ls-vars` command --- cmd/vale/command.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/vale/command.go b/cmd/vale/command.go index d272e55b..f44ec27a 100644 --- a/cmd/vale/command.go +++ b/cmd/vale/command.go @@ -241,11 +241,15 @@ func runRule(args []string, _ *core.CLIFlags) error { func printVars(_ []string, _ *core.CLIFlags) error { tableData := pterm.TableData{ - {"Variable", "Description"}, + {"Variable", "Description", "Set"}, } for v, info := range core.ConfigVars { - tableData = append(tableData, []string{pterm.Gray(v), info}) + found := pterm.FgGreen.Sprint("✓") + if _, ok := os.LookupEnv(v); !ok { + found = pterm.FgRed.Sprint("✗") + } + tableData = append(tableData, []string{pterm.Gray(v), info, found}) } return pterm.DefaultTable.WithHasHeader().WithData(tableData).Render()