Currently the clean param is executed by the karaf startup scripts. Therefore it's e.g. not possible to clear the cache if you're using karaf-wrapper. Therefore this code should rather be moved directly in the karaf main jar instead of the script. In addition there are situations where you don't want to delete the data folder, but rather only the cache folder in KARAF_DATA. Therefore it's a good idea to support a clean-all option (clean is an alias for it) and clean-cache.