wip - pretty print 1.1 compat mode

This commit is contained in:
Mike Farah
2021-08-15 22:07:05 +10:00
parent d2e89f7c72
commit 09e5c5b5c5
2 changed files with 5 additions and 6 deletions
+3 -2
View File
@@ -44,10 +44,11 @@ expression and prints the result in sequence.`,
}
func processExpression(expression string) string {
var prettyPrintExp = `(... | (select(tag != "!!str"), select(tag == "!!str") | select(test("(?i)^(y|yes|n|no|on|off)$") | not)) ) style=""`
if prettyPrint && expression == "" {
return `... style=""`
return prettyPrintExp
} else if prettyPrint {
return fmt.Sprintf("%v | ... style= \"\"", expression)
return fmt.Sprintf("%v | %v", expression, prettyPrintExp)
}
return expression
}