2008-09-10 18:11:04 -06:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2009-12-15 16:29:53 -07:00
|
|
|
"os"
|
2011-07-09 04:16:45 -06:00
|
|
|
"flag" // command line option parser
|
2008-09-10 18:11:04 -06:00
|
|
|
)
|
|
|
|
|
2009-11-07 19:05:30 -07:00
|
|
|
var omitNewline = flag.Bool("n", false, "don't print final newline")
|
2008-09-10 18:11:04 -06:00
|
|
|
|
|
|
|
const (
|
2011-07-09 04:16:45 -06:00
|
|
|
Space = " "
|
2009-12-15 16:29:53 -07:00
|
|
|
Newline = "\n"
|
2008-09-10 18:11:04 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2011-07-09 04:16:45 -06:00
|
|
|
flag.Parse() // Scans the arg list and sets up flags
|
2009-12-15 16:29:53 -07:00
|
|
|
var s string = ""
|
2009-01-09 16:16:31 -07:00
|
|
|
for i := 0; i < flag.NArg(); i++ {
|
2008-09-10 18:11:04 -06:00
|
|
|
if i > 0 {
|
2009-11-01 21:47:03 -07:00
|
|
|
s += Space
|
2008-09-10 18:11:04 -06:00
|
|
|
}
|
2009-12-15 16:29:53 -07:00
|
|
|
s += flag.Arg(i)
|
2008-09-10 18:11:04 -06:00
|
|
|
}
|
2009-11-07 19:05:30 -07:00
|
|
|
if !*omitNewline {
|
2009-11-01 21:47:03 -07:00
|
|
|
s += Newline
|
2008-09-10 18:11:04 -06:00
|
|
|
}
|
2009-12-15 16:29:53 -07:00
|
|
|
os.Stdout.WriteString(s)
|
2008-09-10 18:11:04 -06:00
|
|
|
}
|