From a703dd375cacb48d90444fb92f642ad3849ddff6 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Thu, 17 Dec 2020 21:18:14 +0300 Subject: [PATCH] fix docs and readme --- README.md | 42 +++++++++++++++++++++--------------------- cmd/multini/args.go | 3 +-- doc/README | 2 +- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index dbc5827..2ade7f4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![tests](https://github.com/GenZmeY/multini/workflows/tests/badge.svg)](https://github.com/GenZmeY/multini/actions?query=workflow%3Atests) [![CodeQL](https://github.com/GenZmeY/multini/workflows/CodeQL/badge.svg)](https://github.com/GenZmeY/multini/security/code-scanning) [![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/GenZmeY/multini)](https://golang.org) -[![GitHub](https://img.shields.io/github/license/genzmey/multini)](https://github.com/GenZmeY/multini/blob/master/LICENSE) +[![GitHub](https://img.shields.io/github/license/genzmey/multini)](LICENSE) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/GenZmeY/multini)](https://github.com/GenZmeY/multini/releases) *Command line utility for manipulating ini files with duplicate key names.* @@ -41,7 +41,7 @@ Most implementations only support having one property with a given name in a sec # Usage ``` -Usage: multini [OPTION]... ACTION ini_file [section] [param] [value] +Usage: multini [OPTION]... ACTION ini_file [section] [key] [value] Actions: -g, --get Get values for a given combination of parameters. -s, --set Set values for a given combination of parameters. @@ -65,7 +65,7 @@ Options: # Examples **output a global value not in a section:** -`multini --get ini_file '' param` +`multini --get ini_file '' key` **output section:** `multini --get ini_file section` @@ -74,36 +74,36 @@ Options: `multini --get ini_file` **output value:** -`multini --get ini_file section param` -- if there are several parameters, a list of all values of this parameter will be displayed +`multini --get ini_file section key` +- if there are several keys, a list of all values of this keys will be displayed -**add/update a single parameter:** -`multini --set ini_file section parameter value` -- if there is no parameter, it will be added -- if the parameter exists, the value will be updated -- if the parameter exists and has several values, the parameter with the specified value will be set, the rest of the values will be deleted +**create/update a single key:** +`multini --set ini_file section key value` +- if there is no key, it will be added +- if the key exists, the value will be updated +- if the key exists and has several values, the key with the specified value will be set, the rest of the values will be deleted -**add a parameter with specified value:** -`multini --add ini_file section parameter value` -- if there is no parameter, it will be added -- if the parameter exists and does not have the specified value, the new value will be added +**add a key with specified value:** +`multini --add ini_file section key value` +- if there is no key, it will be added +- if the key exists and does not have the specified value, the new value will be added - if the specified value repeats the existing one, no changes will be made -**delete all parameters with specified name:** -`multini --del ini_file section parameter` +**delete all keys with specified name:** +`multini --del ini_file section key` -**delete a parameter with specified name and value:** -`multini --del ini_file section parameter value` +**delete a key with specified name and value:** +`multini --del ini_file section key value` **delete a section:** `multini --del ini_file section` **short options can be combined:** -`multini -gq ini_file section parameter value` -- check the existence of a parameter with a given value using the return code +`multini -gq ini_file section key value` +- check the existence of a key with a given value using the return code # License Copyright © 2020 GenZmeY -The content of this repository is licensed under [MIT License](https://github.com/GenZmeY/multini/blob/master/LICENSE). +The content of this repository is licensed under [MIT License](LICENSE). diff --git a/cmd/multini/args.go b/cmd/multini/args.go index 8e88e54..549b10f 100644 --- a/cmd/multini/args.go +++ b/cmd/multini/args.go @@ -40,7 +40,7 @@ var ( func printHelp() { output.Println("A utility for manipulating ini files with duplicate keys") output.Println("") - output.Println("Usage: multini [OPTION]... [ACTION] config_file [section] [param] [value]") + output.Println("Usage: multini [OPTION]... [ACTION] config_file [section] [key] [value]") output.Println("Actions:") output.Println(" -g, --get Get values for a given combination of parameters.") output.Println(" -s, --set Set values for a given combination of parameters.") @@ -55,7 +55,6 @@ func printHelp() { output.Println(" This is not atomic but has less restrictions") output.Println(" than the default replacement method.") output.Println(" -o, --output FILE Write output to FILE instead. '-' means stdout") - // output.Println(" -v, --verbose Indicate on stderr if changes were made") output.Println(" -u, --unix Use LF as end of line") output.Println(" -w, --windows Use CRLF as end of line") output.Println(" -q, --quiet Suppress all normal output") diff --git a/doc/README b/doc/README index 3389aff..d9a852f 100644 --- a/doc/README +++ b/doc/README @@ -1,6 +1,6 @@ A utility for manipulating ini files with duplicate keys -Usage: multini [OPTION]... [ACTION] config_file [section] [param] [value] +Usage: multini [OPTION]... [ACTION] config_file [section] [key] [value] Actions: -g, --get Get values for a given combination of parameters. -s, --set Set values for a given combination of parameters.