github.com/rminnich/u-root@v7.0.0+incompatible/cmds/core/yes/yes.go (about)

     1  // Copyright 2017-2019 the u-root Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  import (
     8  	"flag"
     9  	"fmt"
    10  	"strings"
    11  )
    12  
    13  func main() {
    14  	flag.Parse()
    15  	args := flag.Args()
    16  	yes := "y"
    17  	if len(args) > 0 {
    18  		yes = strings.Join(args, " ")
    19  	}
    20  	for {
    21  		if _, err := fmt.Println(yes); err != nil {
    22  			break
    23  		}
    24  	}
    25  }