2019-10-30 02:54:45 +03:00
|
|
|
/* Simple 'echo' implementation. */
|
|
|
|
package echo
|
|
|
|
|
|
|
|
import (
|
2020-01-06 10:28:48 +03:00
|
|
|
"fmt"
|
2019-10-30 02:54:45 +03:00
|
|
|
"flag"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Run(args []string) int {
|
|
|
|
flagSet := flag.NewFlagSet(args[0], flag.ExitOnError)
|
|
|
|
flagSet.Parse(args[1:])
|
2020-01-06 10:28:48 +03:00
|
|
|
args = args[1:]
|
|
|
|
status := 0
|
|
|
|
l := len(args) - 1
|
|
|
|
for i, s := range args {
|
|
|
|
fmt.Print(s)
|
|
|
|
if i!=l { fmt.Print(" ") }
|
2019-10-30 02:54:45 +03:00
|
|
|
}
|
2020-01-06 10:28:48 +03:00
|
|
|
fmt.Print("\n")
|
|
|
|
return status
|
2019-10-30 02:54:45 +03:00
|
|
|
}
|