Allow not explicitly specifying targets

This commit is contained in:
Joscha 2019-12-07 22:22:26 +00:00
parent f32ee5a1e3
commit 4ada2c37f5
2 changed files with 6 additions and 2 deletions

View file

@ -122,8 +122,8 @@ DEFAULT_CONFIG.add(
DEFAULT_CONFIG.add( DEFAULT_CONFIG.add(
"targets", "targets",
"The locations a config file should be placed in. Must be set for all files. Either a path or a list of paths", "The locations a config file should be placed in. Either a path or a list of paths",
has_constant_value=False) value=[])
DEFAULT_CONFIG.add( DEFAULT_CONFIG.add(
"action", "action",

View file

@ -109,6 +109,10 @@ class Processor:
self._update_known_hash(target) self._update_known_hash(target)
def _process_parseable(self, lines: List[str], config: Config, source: Path) -> None: def _process_parseable(self, lines: List[str], config: Config, source: Path) -> None:
if not config.targets:
logger.info(" (no targets)")
return
for target in config.targets: for target in config.targets:
logger.info(f" -> {style_path(str(target))}") logger.info(f" -> {style_path(str(target))}")