Zygo / bees

Best-Effort Extent-Same, a btrfs dedupe agent
GNU General Public License v3.0
647 stars 55 forks source link

bees: Defer full initialization until cmdline parser is done #136

Open kakra opened 4 years ago

kakra commented 4 years ago

Do not touch BeesContext until really needed. As a safety, move its initialization after cmdline parsing. Then follow the proven design of adding the needed default value and apply it to BeesContext later.

Also, let's set a flag when initialization after cmdline parsing is done so we know if we already want to log an exit code.

Fixes: commit 23f3e4ec42e183cdeeb38a44445adb36434a7925 Closes: https://github.com/Zygo/bees/issues/103 Signed-off-by: Kai Krakow kai@kaishome.de

kakra commented 4 years ago

Hmm, it's not yet quite done... During normal startup, log settings are still applied too late. But feel free to merge anyways.