diff --git a/docs/usage.md b/docs/usage.md index 9d3e375..f1dea23 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -259,3 +259,7 @@ export DOTDROP_TMPDIR="/tmp/dotdrop-tmp" ```bash export DOTDROP_WORKDIR="/tmp/dotdrop-workdir" ``` +* `DOTDROP_WORKERS`: overwrite the `-w --workers` cli argument +```bash +export DOTDROP_WORKERS="10" +``` diff --git a/dotdrop/options.py b/dotdrop/options.py index 2c5cf93..bdf74cf 100644 --- a/dotdrop/options.py +++ b/dotdrop/options.py @@ -25,6 +25,7 @@ ENV_NOBANNER = 'DOTDROP_NOBANNER' ENV_DEBUG = 'DOTDROP_DEBUG' ENV_NODEBUG = 'DOTDROP_FORCE_NODEBUG' ENV_XDG = 'XDG_CONFIG_HOME' +ENV_WORKERS = 'DOTDROP_WORKERS' BACKUP_SUFFIX = '.dotdropbak' PROFILE = socket.gethostname() @@ -247,7 +248,11 @@ class Options(AttrMonitor): if a.kind == Action.post] self.install_ignore = self.instignore try: - self.install_parallel = int(self.args['--workers']) + if ENV_WORKERS in os.environ: + workers = int(os.environ[ENV_WORKERS]) + else: + workers = int(self.args['--workers']) + self.install_parallel = workers except ValueError: self.log.err('bad option for --workers') sys.exit(USAGE)