Last active
November 23, 2015 06:27
-
-
Save RyanBreaker/26e896a04d5cc53d95d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"flag" | |
) | |
func main() { | |
var noNewLine bool | |
flag.BoolVar(&noNewLine, "n", false, "Do not print the trailing newline character.") | |
flag.Parse() | |
for i := len(flag.Args()) - flag.NArg(); i < flag.NArg(); i++ { | |
fmt.Print(flag.Arg(i)) | |
if i != flag.NArg() - 1 { | |
fmt.Print(" ") | |
} | |
} | |
if !noNewLine { | |
fmt.Println() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment