Skip to content

Commit 806f476

Browse files
committed
Remove the --quiet and --legacy options
1 parent f69839f commit 806f476

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

CHANGELOG

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ CHANGELOG
44
* 2.0.0 (2023-XX-XX)
55

66
* move to go.mod
7-
* deprecate the `--quiet` option (append `2>/dev/null` to the command instead)
7+
* remove the `--quiet` option (append `2>/dev/null` to the command instead)
8+
* remove the `--legacy` option (same as `--git '<1.8.2'`)
9+
810
* move information console display to stderr instead of stdout
911

1012
* 1.0.1 (2017-02-24)

main.go

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (p *prefixesFlag) Set(value string) error {
4242

4343
var prefixes prefixesFlag
4444
var origin, target, commit, path, gitVersion string
45-
var scratch, debug, quiet, legacy, progress, v bool
45+
var scratch, debug, progress, v bool
4646

4747
func init() {
4848
flag.Var(&prefixes, "prefix", "The directory(ies) to split")
@@ -52,8 +52,6 @@ func init() {
5252
flag.StringVar(&path, "path", ".", "The repository path (optional, current directory by default)")
5353
flag.BoolVar(&scratch, "scratch", false, "Flush the cache (optional)")
5454
flag.BoolVar(&debug, "debug", false, "Enable the debug mode (optional)")
55-
flag.BoolVar(&quiet, "quiet", false, "[DEPRECATED] Suppress the output (optional)")
56-
flag.BoolVar(&legacy, "legacy", false, "[DEPRECATED] Enable the legacy mode for projects migrating from an old version of git subtree split (optional)")
5755
flag.StringVar(&gitVersion, "git", "latest", "Simulate a given version of Git (optional)")
5856
flag.BoolVar(&progress, "progress", false, "Show progress bar (optional, cannot be enabled when debug is enabled)")
5957
flag.BoolVar(&v, "version", false, "Show version")
@@ -72,30 +70,21 @@ func main() {
7270
os.Exit(1)
7371
}
7472

75-
if legacy {
76-
fmt.Fprintln(os.Stderr, `The --legacy option is deprecated (use --git="<1.8.2" instead)`)
77-
gitVersion = "<1.8.2"
78-
}
79-
80-
if quiet {
81-
fmt.Fprintln(os.Stderr, `The --quiet option is deprecated (append 2>/dev/null to the command instead)`)
82-
}
83-
8473
config := &splitter.Config{
8574
Path: path,
8675
Origin: origin,
8776
Prefixes: []*splitter.Prefix(prefixes),
8877
Target: target,
8978
Commit: commit,
90-
Debug: debug && !quiet,
79+
Debug: debug,
9180
Scratch: scratch,
9281
GitVersion: gitVersion,
9382
}
9483

9584
result := &splitter.Result{}
9685

9786
var ticker *time.Ticker
98-
if progress && !debug && !quiet {
87+
if progress && !debug {
9988
ticker = time.NewTicker(time.Millisecond * 50)
10089
go func() {
10190
for range ticker.C {
@@ -113,9 +102,7 @@ func main() {
113102
ticker.Stop()
114103
}
115104

116-
if !quiet {
117-
fmt.Fprintf(os.Stderr, "%d commits created, %d commits traversed, in %s\n", result.Created(), result.Traversed(), result.Duration(time.Millisecond))
118-
}
105+
fmt.Fprintf(os.Stderr, "%d commits created, %d commits traversed, in %s\n", result.Created(), result.Traversed(), result.Duration(time.Millisecond))
119106

120107
if result.Head() != nil {
121108
fmt.Println(result.Head().String())

0 commit comments

Comments
 (0)