1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-08 07:54:16 +00:00

adding a gencfg command

This commit is contained in:
deadc0de6
2024-10-23 14:06:39 +02:00
committed by deadc0de
parent d5d00ef9c0
commit d252756e46
8 changed files with 44 additions and 20 deletions

View File

@@ -21,6 +21,7 @@ from dotdrop.cfg_aggregator import CfgAggregator
from dotdrop.action import Action
from dotdrop.utils import uniq_list, debug_list, debug_dict
from dotdrop.exceptions import YamlException, OptionsException
from dotdrop.config import default_config
ENV_PROFILE = 'DOTDROP_PROFILE'
ENV_CONFIG = 'DOTDROP_CONFIG'
@@ -72,6 +73,7 @@ Usage:
dotdrop files [-VbTG] [-c <path>] [-p <profile>]
dotdrop detail [-Vb] [-c <path>] [-p <profile>] [<key>...]
dotdrop profiles [-VbG] [-c <path>]
dotdrop gencfg
dotdrop --help
dotdrop --version
@@ -148,6 +150,12 @@ class Options(AttrMonitor):
self.args = {}
if not args:
self.args = docopt(USAGE, version=VERSION)
if self.args['gencfg']:
# print config and exit
print(default_config)
sys.exit(0)
if args:
self.args = args.copy()
self.debug = self.args['--verbose'] or ENV_DEBUG in os.environ