diff --git a/cmd/constant.go b/cmd/constant.go index 4a17d53e..d2774573 100644 --- a/cmd/constant.go +++ b/cmd/constant.go @@ -12,7 +12,7 @@ var forceColor = false var forceNoColor = false var colorsEnabled = false var indent = 2 -var printDocSeparators = true +var noDocSeparators = false var nullInput = false var verbose = false var version = false diff --git a/cmd/evaluate_all_command.go b/cmd/evaluate_all_command.go index e9a717ae..246ddf27 100644 --- a/cmd/evaluate_all_command.go +++ b/cmd/evaluate_all_command.go @@ -39,7 +39,7 @@ func evaluateAll(cmd *cobra.Command, args []string) error { if forceColor || (!forceNoColor && (fileInfo.Mode()&os.ModeCharDevice) != 0) { colorsEnabled = true } - printer := yqlib.NewPrinter(out, outputToJSON, unwrapScalar, colorsEnabled, indent, printDocSeparators) + printer := yqlib.NewPrinter(out, outputToJSON, unwrapScalar, colorsEnabled, indent, !noDocSeparators) switch len(args) { case 0: diff --git a/cmd/evalute_sequence_command.go b/cmd/evalute_sequence_command.go index 63077186..ab9480e9 100644 --- a/cmd/evalute_sequence_command.go +++ b/cmd/evalute_sequence_command.go @@ -39,7 +39,7 @@ func evaluateSequence(cmd *cobra.Command, args []string) error { if forceColor || (!forceNoColor && (fileInfo.Mode()&os.ModeCharDevice) != 0) { colorsEnabled = true } - printer := yqlib.NewPrinter(out, outputToJSON, unwrapScalar, colorsEnabled, indent, printDocSeparators) + printer := yqlib.NewPrinter(out, outputToJSON, unwrapScalar, colorsEnabled, indent, !noDocSeparators) switch len(args) { case 0: diff --git a/cmd/root.go b/cmd/root.go index cdda014c..4a225ef4 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -57,6 +57,7 @@ func New() *cobra.Command { rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "verbose mode") rootCmd.PersistentFlags().BoolVarP(&outputToJSON, "tojson", "j", false, "output as json. Set indent to 0 to print json in one line.") rootCmd.PersistentFlags().BoolVarP(&nullInput, "null-input", "n", false, "Don't read input, simply evaluate the expression given. Useful for creating yaml docs from scratch.") + rootCmd.PersistentFlags().BoolVarP(&noDocSeparators, "no-doc", "N", false, "Don't print document separators (---)") rootCmd.PersistentFlags().IntVarP(&indent, "indent", "I", 2, "sets indent level for output") rootCmd.Flags().BoolVarP(&version, "version", "V", false, "Print version information and quit") diff --git a/cmd/version.go b/cmd/version.go index 394dc638..85d92382 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -11,7 +11,7 @@ var ( GitDescribe string // Version is main version number that is being run at the moment. - Version = "4.0.0-beta" + Version = "4.0.0-alpha1" // VersionPrerelease is a pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release