• R/O
  • HTTP
  • SSH
  • HTTPS

crshini: Commit

GitHubのミラーです
https://github.com/hayao0819/crshini


Commit MetaInfo

Revisão0e309b82ef9d0102280614c57b5355ee6b1aa167 (tree)
Hora2021-06-08 22:38:46
Autorhayao <hayao@fasc...>
Commiterhayao

Mensagem de Log

[update] : Updated libcrshini's document

Mudança Sumário

Diff

--- a/libcrshini.md
+++ b/libcrshini.md
@@ -2,7 +2,7 @@
22 libcrishini is a library that can be used by loading it with a shell script.
33 This library uses various values by passing them to functions in several ways.
44
5-## Basic usage
5+## Usage
66
77 ### Load the library
88 First, load this library with the source command in some way.
@@ -61,4 +61,56 @@ If no parameter is specified, a list of parameters will be output.
6161
6262 In the example below, ini is read from standard input by setting _crshini_stdin to true.
6363
64+Set the environment variable `_crshini_get_linemode` to get line number where the value is set instead of the value.
6465
66+#### _crshini_set
67+The `_crshini_set` function is used to set section , param and value. It is mainly used in the following syntax.
68+You can create new parameters or rewrite existing ones.
69+
70+```bash
71+_crshini_set file section param value
72+cat file | _crshini_stdin=true _crshini_set section param value
73+```
74+None of the arguments can be omitted.
75+
76+#### _crshini_merge
77+This function is used to merge two INI files.It combines the file specified by the argument with the standard input file.
78+The value of _crshini_stdin is ignored and always reads standard input.
79+
80+```bash
81+cat input_file | _crshini_merge file [section]
82+```
83+You can also limit the sections to be merged.
84+
85+#### _crshini_del
86+The `_crshini_del` function is used to delete section or param.
87+
88+```bash
89+_crshini_del file section [param1] [param2] ...
90+cat file | _crshini_stdin=true _crshini_del section [param1] [param2] ...
91+```
92+If no parameter is specified, all sections will be deleted. You can also specify multiple parameters.
93+
94+### library variables
95+You can change the behavior of the function with environment variables.
96+
97+#### Input data from stdin instead of specifying a file
98+Set `_crshini_stdin` to `true`
99+
100+#### Output debug message
101+Set `_crshini_debug` to `true`
102+
103+#### Specify the output destination
104+Set `_crshini_output` to the path. Set `-` to output to standard output.
105+
106+#### Specify the path of temporary file
107+Set `temporary file` to the path. Default is `/tmp/libcrshini`.
108+Temporary files are used by some functions for a variety of purposes.
109+
110+#### Get line number
111+Set `_crshini_get_linemode` to `true`
112+This variable only works in some modes of `_crshini_get`. Otherwise it will be ignored.
113+
114+
115+## Exapmle
116+The crshini command is also developed in this project as an implementation example of libcrshini.
Show on old repository browser