It allows to get command= be applied in case the given jail exists and -cm means modification instead of creation. It also handles a case when nopersist command= is used, i.e. the command runs first and nopersist takes place after, what removes the jail after the command, not before.
I think it could be found useful in some scripting and other simple cases when it needs no additional if/else logic, e.g. it could be a sequence of invocations with the same set of jail params, but different commands, and when we know that this is the last command and a jail should be revoked we could simply add nopersist to the params:
- jail -cm <the-same-params-with-persist> command=one
- jail -cm <the-same-params-with-persist> command=two
- jail -cm <the-same-params-with-persist> nopersist command=last
Initially this patch was created while I was working on the cheapest variant of kyua jail support, but it ended up with another, more explicit, approach.
As long as some time was invested I would like to share this prototype, in case it's found interesting. But I completely understand that it can be a definite "no-no" due to established behavior and philosophy.