Skip to content

Commit

Permalink
feat: add -y flag
Browse files Browse the repository at this point in the history
  • Loading branch information
futrime committed Feb 17, 2023
1 parent 246440a commit 964fcb6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.0] - 2023-02-17
### Added
- `-y` flag to skip confirmation

## [0.1.0] - 2023-02-09

### Added
- Basic functionality


[unreleased]: https://github.com/LiteLDev/Lip/compare/v0.1.0...HEAD
[unreleased]: https://github.com/LiteLDev/Lip/compare/v0.2.0...HEAD
[0.2.0]: https://github.com/LiteLDev/Lip/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/LiteLDev/Lip/releases/tag/v0.1.0
9 changes: 8 additions & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ func main() {
fmt.Println("- Microsoft Privacy Policy https://go.microsoft.com/fwlink/?LinkId=521839")

usePreview := false
skipAgree := false
flagSet := flag.NewFlagSet("bdsdown", flag.ExitOnError)
flagSet.BoolVar(&usePreview, "preview", false, "Use preview version")
flagSet.BoolVar(&skipAgree, "y", false, "Skip the agreement")
flagSet.Usage = func() {
fmt.Println("Usage: bdsdown [options] [version]")
fmt.Println("Options:")
Expand All @@ -40,7 +42,12 @@ func main() {

fmt.Print("Please enter y if you agree with the above terms: ")
var agree string
fmt.Scanln(&agree)
if skipAgree {
agree = "y"
fmt.Println(agree)
} else {
fmt.Scanln(&agree)
}
if agree != "y" {
fmt.Println(ColorYellow + "You must agree with the above terms to use this software." + ColorReset)
return
Expand Down

0 comments on commit 964fcb6

Please sign in to comment.