Skip to content

Commit

Permalink
Add usage warning about destructive changes
Browse files Browse the repository at this point in the history
  • Loading branch information
samb1729 committed Jun 6, 2016
1 parent 6a26cc6 commit f2455e5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/tomll/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"flag"
"fmt"
"io"
"io/ioutil"
"os"
Expand All @@ -10,6 +11,17 @@ import (
)

func main() {
flag.Usage = func() {
fmt.Fprintln(os.Stderr, `tomll can be used in two ways:
Writing to STDIN and reading from STDOUT:
cat file.toml | tomll > file.toml
Reading and updating a list of files:
tomll a.toml b.toml c.toml
When given a list of files, tomll will modify all files in place without asking.
`)
}
flag.Parse()
// read from stdin and print to stdout
if flag.NArg() == 0 {
Expand Down

0 comments on commit f2455e5

Please sign in to comment.