337
338
339
340
341
342
343
344
345
346
347
348
349
350
...
365
366
367
368
369
370
371
372
373
374
375
376
377
378
|
srv:setup(cnf)
elseif lib.str.cmp(mode.arglist(0),'conf') == 0 then
srv:setup(cnf)
srv:conprep(lib.store.prepmode.conf)
var cfmode: lib.cmdparse {
help = {'h','display this list'};
no_notify = {'n', "don't instruct the server to refresh its configuration cache after making changes; useful for \"transactional\" configuration changes."};
}
cfmode:parse(mode.arglist.ct, &mode.arglist(0))
if cfmode.help then
[ lib.emit(false, 1, 'usage: ', `argv[0], ' conf ', cfmode.type.helptxt.flags, ' <cmd> [<args>…]', cfmode.type.helptxt.opts, cmdhelp {
{ 'conf set <setting> <value>', 'add or a change a server configuration parameter to the database' };
{ 'conf get <setting>', 'report the value of a server setting' };
{ 'conf reset <setting>', 'reset a server setting to its default value' };
................................................................................
else goto cmderr end
elseif cfmode.arglist.ct == 2 and
lib.str.cmp(cfmode.arglist(0),'reset') == 0 or
lib.str.cmp(cfmode.arglist(0),'clear') == 0 or
lib.str.cmp(cfmode.arglist(0),'unset') == 0 then
dlg:conf_reset(cfmode.arglist(1))
lib.report('parameter cleared')
elseif cfmode.arglist.ct == 3 and
lib.str.cmp(cfmode.arglist(0),'set') == 0 then
dlg:conf_set(cfmode.arglist(1),cfmode.arglist(2))
lib.report('parameter set')
else goto cmderr end
-- successful commands fall through
|
|
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
...
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
|
srv:setup(cnf)
elseif lib.str.cmp(mode.arglist(0),'conf') == 0 then
srv:setup(cnf)
srv:conprep(lib.store.prepmode.conf)
var cfmode: lib.cmdparse {
help = {'h','display this list'};
no_notify = {'n', "don't instruct the server to refresh its configuration cache after making changes; useful for \"transactional\" configuration changes."};
raw = {'r', 'print output suitable for use in scripting rather than human consumption'};
}
cfmode:parse(mode.arglist.ct, &mode.arglist(0))
if cfmode.help then
[ lib.emit(false, 1, 'usage: ', `argv[0], ' conf ', cfmode.type.helptxt.flags, ' <cmd> [<args>…]', cfmode.type.helptxt.opts, cmdhelp {
{ 'conf set <setting> <value>', 'add or a change a server configuration parameter to the database' };
{ 'conf get <setting>', 'report the value of a server setting' };
{ 'conf reset <setting>', 'reset a server setting to its default value' };
................................................................................
else goto cmderr end
elseif cfmode.arglist.ct == 2 and
lib.str.cmp(cfmode.arglist(0),'reset') == 0 or
lib.str.cmp(cfmode.arglist(0),'clear') == 0 or
lib.str.cmp(cfmode.arglist(0),'unset') == 0 then
dlg:conf_reset(cfmode.arglist(1))
lib.report('parameter cleared')
elseif cfmode.arglist.ct == 2 and
lib.str.cmp(cfmode.arglist(0),'get') == 0 then
var val = dlg:conf(cfmode.arglist(1))
if val:ref() then
lib.report('parameter read')
[ lib.emit(true, 1, `cfmode.arglist(1), ' = "', `{val.ptr,val.ct}, '"') ]
else
lib.warn('no such parameter present in configuration store')
end
elseif cfmode.arglist.ct == 3 and
lib.str.cmp(cfmode.arglist(0),'set') == 0 then
dlg:conf_set(cfmode.arglist(1),cfmode.arglist(2))
lib.report('parameter set')
else goto cmderr end
-- successful commands fall through
|