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-01-09 16:16:31 -07:00
|
|
|
"os";
|
|
|
|
"flag";
|
2008-09-10 18:11:04 -06:00
|
|
|
)
|
|
|
|
|
2009-01-09 16:16:31 -07:00
|
|
|
var n_flag = flag.Bool("n", false, "don't print final newline")
|
2008-09-10 18:11:04 -06:00
|
|
|
|
|
|
|
const (
|
|
|
|
Space = " ";
|
|
|
|
Newline = "\n";
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2009-01-09 16:16:31 -07:00
|
|
|
flag.Parse(); // Scans the arg list and sets up flags
|
2008-09-10 18:11:04 -06: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 {
|
|
|
|
s += Space
|
|
|
|
}
|
2009-01-09 16:16:31 -07:00
|
|
|
s += flag.Arg(i)
|
2008-09-10 18:11:04 -06:00
|
|
|
}
|
2009-01-09 16:16:31 -07:00
|
|
|
if !*n_flag {
|
2008-09-10 18:11:04 -06:00
|
|
|
s += Newline
|
|
|
|
}
|
2009-01-09 16:16:31 -07:00
|
|
|
os.Stdout.WriteString(s);
|
2008-09-10 18:11:04 -06:00
|
|
|
}
|