From 4a73a200ed8f025228a93885b925bedc3ae0027a Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Fri, 31 Dec 2021 15:56:40 -0500 Subject: [PATCH] Clean up tools godoc --- cmd/jsontoml/main.go | 20 ++++++++++++++++---- cmd/tomljson/main.go | 14 +++++++++++++- cmd/tomll/main.go | 20 ++++++++++++++++---- 3 files changed, 45 insertions(+), 9 deletions(-) diff --git a/cmd/jsontoml/main.go b/cmd/jsontoml/main.go index 5f14fc6a..a95aa625 100644 --- a/cmd/jsontoml/main.go +++ b/cmd/jsontoml/main.go @@ -1,8 +1,20 @@ -// Jsontoml reads JSON and converts to TOML. +// Package jsontoml is a program that converts JSON to TOML. // -// Usage: -// cat file.toml | jsontoml > file.json -// jsontoml file1.toml > file.json +// Usage +// +// Reading from stdin: +// +// cat file.json | jsontoml > file.toml +// +// Reading from a file: +// +// jsontoml file.json > file.toml +// +// Installation +// +// Using Go: +// +// go install github.com/pelletier/go-toml/v2/cmd/jsontoml@latest package main import ( diff --git a/cmd/tomljson/main.go b/cmd/tomljson/main.go index 966e37da..8fc6bb5b 100644 --- a/cmd/tomljson/main.go +++ b/cmd/tomljson/main.go @@ -1,8 +1,20 @@ // Package tomljson is a program that converts TOML to JSON. // -// Usage: +// Usage +// +// Reading from stdin: +// // cat file.toml | tomljson > file.json +// +// Reading from a file: +// // tomljson file.toml > file.json +// +// Installation +// +// Using Go: +// +// go install github.com/pelletier/go-toml/v2/cmd/tomljson@latest package main import ( diff --git a/cmd/tomll/main.go b/cmd/tomll/main.go index 3cfca7e8..94f68a25 100644 --- a/cmd/tomll/main.go +++ b/cmd/tomll/main.go @@ -1,8 +1,20 @@ -// Tomll is a linter for TOML +// Package tomll is a linter program for TOML. // -// Usage: -// cat file.toml | tomll > file_linted.toml -// tomll file1.toml file2.toml # lint the two files in place +// Usage +// +// Reading from stdin, writing to stdout: +// +// cat file.toml | tomll +// +// Reading and updating a list of files in place: +// +// tomll a.toml b.toml c.toml +// +// Installation +// +// Using Go: +// +// go install github.com/pelletier/go-toml/v2/cmd/tomll@latest package main import (