2020-01-13 09:11:56 +00:00
|
|
|
package cmd
|
|
|
|
|
2024-11-06 10:12:03 +00:00
|
|
|
import "os"
|
|
|
|
|
2022-11-10 11:07:53 +00:00
|
|
|
var unwrapScalarFlag = newUnwrapFlag()
|
2022-11-10 08:21:18 +00:00
|
|
|
|
|
|
|
var unwrapScalar = false
|
2020-11-13 03:07:11 +00:00
|
|
|
|
2020-11-29 09:25:47 +00:00
|
|
|
var writeInplace = false
|
2020-01-13 09:11:56 +00:00
|
|
|
var outputToJSON = false
|
2023-03-15 02:22:58 +00:00
|
|
|
|
|
|
|
var outputFormat = ""
|
|
|
|
|
2023-03-08 23:17:19 +00:00
|
|
|
var inputFormat = ""
|
2021-12-21 04:02:07 +00:00
|
|
|
|
2020-11-30 05:35:21 +00:00
|
|
|
var exitStatus = false
|
2020-02-03 05:52:12 +00:00
|
|
|
var indent = 2
|
2020-11-13 02:35:59 +00:00
|
|
|
var noDocSeparators = false
|
2020-11-06 03:37:01 +00:00
|
|
|
var nullInput = false
|
2023-03-28 22:51:55 +00:00
|
|
|
var nulSepOutput = false
|
2020-01-13 09:11:56 +00:00
|
|
|
var verbose = false
|
|
|
|
var version = false
|
2020-12-28 00:40:41 +00:00
|
|
|
var prettyPrint = false
|
2020-11-30 05:05:07 +00:00
|
|
|
|
2024-11-06 10:12:03 +00:00
|
|
|
var forceColor = false
|
|
|
|
var forceNoColor = false
|
|
|
|
var colorsEnabled = false
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
// when NO_COLOR environment variable presents and not an empty string the colored output should be disabled;
|
|
|
|
// refer to no-color.org
|
|
|
|
forceNoColor = os.Getenv("NO_COLOR") != ""
|
|
|
|
}
|
|
|
|
|
2021-07-18 02:28:46 +00:00
|
|
|
// can be either "" (off), "extract" or "process"
|
|
|
|
var frontMatter = ""
|
|
|
|
|
2021-10-29 03:14:39 +00:00
|
|
|
var splitFileExp = ""
|
2022-04-29 01:08:41 +00:00
|
|
|
var splitFileExpFile = ""
|
2021-10-29 03:14:39 +00:00
|
|
|
|
2020-11-30 05:05:07 +00:00
|
|
|
var completedSuccessfully = false
|
2022-02-06 22:27:52 +00:00
|
|
|
|
|
|
|
var forceExpression = ""
|
2022-03-01 00:50:09 +00:00
|
|
|
|
|
|
|
var expressionFile = ""
|