| 37 | } |
| 38 | |
| 39 | @Override |
| 40 | protected boolean run() { |
| 41 | final String name = args[0].toUpperCase(Locale.ENGLISH), val = args[1]; |
| 42 | Options opts = options; |
| 43 | |
| 44 | // check static options: only "debug" can be changed by admin users |
| 45 | boolean debug = false; |
| 46 | if(context.user().has(Perm.ADMIN)) { |
| 47 | final Option<?> opt = soptions.option(name); |
| 48 | if(opt == StaticOptions.DEBUG) { |
| 49 | debug = true; |
| 50 | opts = soptions; |
| 51 | } else if(opt != null) { |
| 52 | return error(GLOBAL_OPTION_X, name); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | try { |
| 57 | // set value and return info string with new value |
| 58 | opts.assign(name, val); |
| 59 | // assign static debugging flag |
| 60 | if(debug) Prop.debug = opts.get(StaticOptions.DEBUG); |
| 61 | return info(name + COLS + opts.get(opts.option(name))); |
| 62 | } catch(final BaseXException ex) { |
| 63 | Util.debug(ex); |
| 64 | return error(Util.message(ex)); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | @Override |
| 69 | public void addLocks() { |