diff --git a/CHANGELOG b/CHANGELOG index 8564f09..912cdb9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,7 +4,9 @@ CHANGELOG * 2.0.0 (2023-XX-XX) * move to go.mod - * deprecate the `--quiet` option (append `2>/dev/null` to the command instead) + * remove the `--quiet` option (append `2>/dev/null` to the command instead) + * remove the `--legacy` option (same as `--git '<1.8.2'`) + * move information console display to stderr instead of stdout * 1.0.1 (2017-02-24) diff --git a/main.go b/main.go index 842b7e0..aad01df 100644 --- a/main.go +++ b/main.go @@ -42,7 +42,7 @@ func (p *prefixesFlag) Set(value string) error { var prefixes prefixesFlag var origin, target, commit, path, gitVersion string -var scratch, debug, quiet, legacy, progress, v bool +var scratch, debug, progress, v bool func init() { flag.Var(&prefixes, "prefix", "The directory(ies) to split") @@ -52,8 +52,6 @@ func init() { flag.StringVar(&path, "path", ".", "The repository path (optional, current directory by default)") flag.BoolVar(&scratch, "scratch", false, "Flush the cache (optional)") flag.BoolVar(&debug, "debug", false, "Enable the debug mode (optional)") - flag.BoolVar(&quiet, "quiet", false, "[DEPRECATED] Suppress the output (optional)") - flag.BoolVar(&legacy, "legacy", false, "[DEPRECATED] Enable the legacy mode for projects migrating from an old version of git subtree split (optional)") flag.StringVar(&gitVersion, "git", "latest", "Simulate a given version of Git (optional)") flag.BoolVar(&progress, "progress", false, "Show progress bar (optional, cannot be enabled when debug is enabled)") flag.BoolVar(&v, "version", false, "Show version") @@ -72,22 +70,13 @@ func main() { os.Exit(1) } - if legacy { - fmt.Fprintln(os.Stderr, `The --legacy option is deprecated (use --git="<1.8.2" instead)`) - gitVersion = "<1.8.2" - } - - if quiet { - fmt.Fprintln(os.Stderr, `The --quiet option is deprecated (append 2>/dev/null to the command instead)`) - } - config := &splitter.Config{ Path: path, Origin: origin, Prefixes: []*splitter.Prefix(prefixes), Target: target, Commit: commit, - Debug: debug && !quiet, + Debug: debug, Scratch: scratch, GitVersion: gitVersion, } @@ -95,7 +84,7 @@ func main() { result := &splitter.Result{} var ticker *time.Ticker - if progress && !debug && !quiet { + if progress && !debug { ticker = time.NewTicker(time.Millisecond * 50) go func() { for range ticker.C { @@ -113,9 +102,7 @@ func main() { ticker.Stop() } - if !quiet { - fmt.Fprintf(os.Stderr, "%d commits created, %d commits traversed, in %s\n", result.Created(), result.Traversed(), result.Duration(time.Millisecond)) - } + fmt.Fprintf(os.Stderr, "%d commits created, %d commits traversed, in %s\n", result.Created(), result.Traversed(), result.Duration(time.Millisecond)) if result.Head() != nil { fmt.Println(result.Head().String())