fix docs and readme

This commit is contained in:
GenZmeY 2020-12-17 21:18:14 +03:00
parent 2fbd9030eb
commit a703dd375c
3 changed files with 23 additions and 24 deletions

View File

@ -4,7 +4,7 @@
[![tests](https://github.com/GenZmeY/multini/workflows/tests/badge.svg)](https://github.com/GenZmeY/multini/actions?query=workflow%3Atests) [![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) [![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 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) [![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.* *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
``` ```
Usage: multini [OPTION]... ACTION ini_file [section] [param] [value] Usage: multini [OPTION]... ACTION ini_file [section] [key] [value]
Actions: Actions:
-g, --get Get values for a given combination of parameters. -g, --get Get values for a given combination of parameters.
-s, --set Set values for a given combination of parameters. -s, --set Set values for a given combination of parameters.
@ -65,7 +65,7 @@ Options:
# Examples # Examples
**output a global value not in a section:** **output a global value not in a section:**
`multini --get ini_file '' param` `multini --get ini_file '' key`
**output section:** **output section:**
`multini --get ini_file section` `multini --get ini_file section`
@ -74,36 +74,36 @@ Options:
`multini --get ini_file` `multini --get ini_file`
**output value:** **output value:**
`multini --get ini_file section param` `multini --get ini_file section key`
- if there are several parameters, a list of all values of this parameter will be displayed - if there are several keys, a list of all values of this keys will be displayed
**add/update a single parameter:** **create/update a single key:**
`multini --set ini_file section parameter value` `multini --set ini_file section key value`
- if there is no parameter, it will be added - if there is no key, it will be added
- if the parameter exists, the value will be updated - if the key 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 - 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:** **add a key with specified value:**
`multini --add ini_file section parameter value` `multini --add ini_file section key value`
- if there is no parameter, it will be added - if there is no key, it will be added
- if the parameter exists and does not have the specified value, the new value 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 - if the specified value repeats the existing one, no changes will be made
**delete all parameters with specified name:** **delete all keys with specified name:**
`multini --del ini_file section parameter` `multini --del ini_file section key`
**delete a parameter with specified name and value:** **delete a key with specified name and value:**
`multini --del ini_file section parameter value` `multini --del ini_file section key value`
**delete a section:** **delete a section:**
`multini --del ini_file section` `multini --del ini_file section`
**short options can be combined:** **short options can be combined:**
`multini -gq ini_file section parameter value` `multini -gq ini_file section key value`
- check the existence of a parameter with a given value using the return code - check the existence of a key with a given value using the return code
# License # License
Copyright © 2020 GenZmeY 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).

View File

@ -40,7 +40,7 @@ var (
func printHelp() { func printHelp() {
output.Println("A utility for manipulating ini files with duplicate keys") output.Println("A utility for manipulating ini files with duplicate keys")
output.Println("") 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("Actions:")
output.Println(" -g, --get Get values for a given combination of parameters.") output.Println(" -g, --get Get values for a given combination of parameters.")
output.Println(" -s, --set Set 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(" This is not atomic but has less restrictions")
output.Println(" than the default replacement method.") output.Println(" than the default replacement method.")
output.Println(" -o, --output FILE Write output to FILE instead. '-' means stdout") 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(" -u, --unix Use LF as end of line")
output.Println(" -w, --windows Use CRLF as end of line") output.Println(" -w, --windows Use CRLF as end of line")
output.Println(" -q, --quiet Suppress all normal output") output.Println(" -q, --quiet Suppress all normal output")

View File

@ -1,6 +1,6 @@
A utility for manipulating ini files with duplicate keys 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: Actions:
-g, --get Get values for a given combination of parameters. -g, --get Get values for a given combination of parameters.
-s, --set Set values for a given combination of parameters. -s, --set Set values for a given combination of parameters.