--existing[=WHAT] For --set, --del and --merge, fail if item is missing, where WHAT is 'file', 'section', or 'param', or if not specified; all specified items. --format=FMT For --get, select the output FMT. Formats are sh,ini,lines --inplace Lock and write files in place. This is not atomic but has less restrictions than the default replacement method. --list For --set and --del, update a list (set) of values --list-sep=STR Delimit list values with "STR" instead of " ," --output=FILE Write output to FILE instead. '-' means stdout --verbose Indicate on stderr if changes were made --help Write this help to stdout --version Write version to stdout
对于配置文件 test.ini
1 2 3 4 5 6 7
[DEFAULT] user = testname passwd = testpasswd
[WEBURL] ip = 192.168.5.66 port = 8080
config_file为要修改配置的文件名。例如 test.ini。
section为要修改的某个参数所在的域。例如 DEFAULT或WEBURL。
param为要修改的参数名称。例如user或ip。
value即为要设置参数的值。
添加
1
$ crudini --set config_file section parameter value
更新
1
$ crudini --set [--existing] config_file section parameter value