From fda1c60402a130d99960e9c1ca501d1c8abec02b Mon Sep 17 00:00:00 2001 From: rsteube Date: Thu, 29 Feb 2024 18:20:55 +0100 Subject: [PATCH] diff: added missing flags --- completers/diff_completer/cmd/root.go | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/completers/diff_completer/cmd/root.go b/completers/diff_completer/cmd/root.go index 179cba7737..b11a9e9ba0 100644 --- a/completers/diff_completer/cmd/root.go +++ b/completers/diff_completer/cmd/root.go @@ -23,12 +23,15 @@ func init() { rootCmd.Flags().String("LTYPE-line-format", "", "format LTYPE input lines with LFMT") rootCmd.Flags().BoolP("brief", "q", false, "report only when files differ") rootCmd.Flags().String("color", "", "colorize the output") - rootCmd.Flags().String("context", "", "output NUM (default 3) lines of copied context") + rootCmd.Flags().String("changed-group-format", "", "set changed group format") + rootCmd.Flags().StringP("context", "c", "", "output NUM (default 3) lines of copied context") + rootCmd.Flags().StringS("C", "C", "", "output NUM (default 3) lines of copied context") rootCmd.Flags().BoolP("ed", "e", false, "output an ed script") rootCmd.Flags().StringP("exclude", "x", "", "exclude files that match PAT") rootCmd.Flags().StringP("exclude-from", "X", "", "exclude files that match any pattern in FILE") rootCmd.Flags().BoolP("expand-tabs", "t", false, "expand tabs to spaces in output") rootCmd.Flags().String("from-file", "", "compare FILE1 to all operands") + rootCmd.Flags().BoolP("forward-ed", "f", false, "output a reversed ed script") rootCmd.Flags().Bool("help", false, "display this help and exit") rootCmd.Flags().String("horizon-lines", "", "keep NUM lines of the common prefix and suffix") rootCmd.Flags().StringP("ifdef", "D", "", "output merged file with '#ifdef NAME' diffs") @@ -41,11 +44,13 @@ func init() { rootCmd.Flags().BoolP("ignore-tab-expansion", "E", false, "ignore changes due to tab expansion") rootCmd.Flags().BoolP("ignore-trailing-space", "Z", false, "ignore white space at line end") rootCmd.Flags().BoolP("initial-tab", "T", false, "make tabs line up by prepending a tab") - rootCmd.Flags().String("label", "", "use LABEL instead of file name and timestamp") + rootCmd.Flags().StringP("label", "L", "", "use LABEL instead of file name and timestamp") rootCmd.Flags().Bool("left-column", false, "output only the left column of common lines") rootCmd.Flags().String("line-format", "", "format all input lines with LFMT") rootCmd.Flags().BoolP("minimal", "d", false, "try hard to find a smaller set of changes") rootCmd.Flags().BoolP("new-file", "N", false, "treat absent files as empty") + rootCmd.Flags().String("new-group-format", "", "set new group format") + rootCmd.Flags().String("new-line-format", "", "set new line format") rootCmd.Flags().Bool("no-dereference", false, "don't follow symbolic links") rootCmd.Flags().Bool("no-ignore-file-name-case", false, "consider case when comparing file names") rootCmd.Flags().Bool("normal", false, "output a normal diff (the default)") @@ -57,7 +62,7 @@ func init() { rootCmd.Flags().BoolP("show-c-function", "p", false, "show which C function each change is in") rootCmd.Flags().StringP("show-function-line", "F", "", "show the most recent line matching RE") rootCmd.Flags().BoolP("side-by-side", "y", false, "output in two columns") - rootCmd.Flags().Bool("speed-large-files", false, "assume large files and many scattered small changes") + rootCmd.Flags().BoolP("speed-large-files", "H", false, "assume large files and many scattered small changes") rootCmd.Flags().StringP("starting-file", "S", "", "start with FILE when comparing directories") rootCmd.Flags().Bool("strip-trailing-cr", false, "strip trailing carriage return on input") rootCmd.Flags().Bool("suppress-blank-empty", false, "suppress space or tab before empty output lines") @@ -65,11 +70,19 @@ func init() { rootCmd.Flags().String("tabsize", "", "tab stops every NUM (default 8) print columns") rootCmd.Flags().BoolP("text", "a", false, "treat all files as text") rootCmd.Flags().String("to-file", "", "compare all operands to FILE2") - rootCmd.Flags().Bool("unidirectional-new-file", false, "treat absent first files as empty") - rootCmd.Flags().String("unified", "", "output NUM (default 3) lines of unified context") + rootCmd.Flags().String("old-group-format", "", "set old group format") + rootCmd.Flags().String("old-line-format", "", "set old line format") + rootCmd.Flags().String("unchanged-group-format", "", "set unchanged group format") + rootCmd.Flags().String("unchanged-line-format", "", "set unchanged line format") + rootCmd.Flags().BoolP("unidirectional-new-file", "P", false, "treat absent first files as empty") + rootCmd.Flags().StringP("unified", "u", "", "output NUM (default 3) lines of unified context") + rootCmd.Flags().StringS("U", "U", "", "output NUM (default 3) lines of unified context") rootCmd.Flags().BoolP("version", "v", false, "output version information and exit") rootCmd.Flags().StringP("width", "W", "", "output at most NUM (default 130) print columns") + rootCmd.MarkFlagsMutuallyExclusive("context", "C") + rootCmd.MarkFlagsMutuallyExclusive("unified", "U") + rootCmd.Flag("GTYPE-group-format").NoOptDefVal = " " rootCmd.Flag("LTYPE-line-format").NoOptDefVal = " " rootCmd.Flag("color").NoOptDefVal = " "