2008-09-11 00:11:04 +00: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 23:29:53 +00:00
|
|
|
"os"
|
|
|
|
"flag" // command line option parser
|
2008-09-11 00:11:04 +00:00
|
|
|
)
|
|
|
|
|
2009-11-08 02:05:30 +00:00
|
|
|
var omitNewline = flag.Bool("n", false, "don't print final newline")
|
2008-09-11 00:11:04 +00:00
|
|
|
|
|
|
|
const (
|
2009-12-15 23:29:53 +00:00
|
|
|
Space = " "
|
|
|
|
Newline = "\n"
|
2008-09-11 00:11:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2009-12-15 23:29:53 +00:00
|
|
|
flag.Parse() // Scans the arg list and sets up flags
|
|
|
|
var s string = ""
|
2009-01-09 23:16:31 +00:00
|
|
|
for i := 0; i < flag.NArg(); i++ {
|
2008-09-11 00:11:04 +00:00
|
|
|
if i > 0 {
|
2009-11-02 04:47:03 +00:00
|
|
|
s += Space
|
2008-09-11 00:11:04 +00:00
|
|
|
}
|
2009-12-15 23:29:53 +00:00
|
|
|
s += flag.Arg(i)
|
2008-09-11 00:11:04 +00:00
|
|
|
}
|
2009-11-08 02:05:30 +00:00
|
|
|
if !*omitNewline {
|
2009-11-02 04:47:03 +00:00
|
|
|
s += Newline
|
2008-09-11 00:11:04 +00:00
|
|
|
}
|
2009-12-15 23:29:53 +00:00
|
|
|
os.Stdout.WriteString(s)
|
2008-09-11 00:11:04 +00:00
|
|
|
}
|