yd-cli 0.4__tar.gz → 0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yd-cli
3
- Version: 0.4
3
+ Version: 0.6
4
4
  Summary: CLI tool to synchronize directories using rsync.
5
5
  Author: Christian Heinze
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ requires = [ "uv-build>=0.10,<0.12" ]
4
4
 
5
5
  [project]
6
6
  name = "yd-cli"
7
- version = "0.4"
7
+ version = "0.6"
8
8
  description = "CLI tool to synchronize directories using rsync."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -9,6 +9,7 @@ from __future__ import annotations
9
9
 
10
10
  import dataclasses
11
11
  import itertools as it
12
+ import logging
12
13
  import re
13
14
  import sys
14
15
  from typing import TYPE_CHECKING, Annotated
@@ -127,9 +128,9 @@ def _setup_io() -> None:
127
128
  console.print("Failed to capture environment.", style="error")
128
129
  raise typer.Exit(2) from err
129
130
 
130
- if env.log_level is not None:
131
- import logging
132
-
131
+ if env.log_level is None:
132
+ logging.basicConfig(level=logging.CRITICAL)
133
+ else:
133
134
  import msgspec
134
135
 
135
136
  logging.basicConfig(
@@ -198,6 +199,7 @@ def _clip_path(path: str, *, max_len: int, prefix: str = ".../") -> str:
198
199
  # Use `list` as return value since type must be available at runtime for typer to work.
199
200
  # Argument is passed as kwarg by typer.
200
201
  def _complete_config_name(incomplete: str) -> list[str]:
202
+ env = yd.io.capture_environment()
201
203
  return [
202
204
  path.stem
203
205
  for path in env.config_dir.glob("*.toml")
@@ -94,6 +94,8 @@ def create( # noqa: PLR0915
94
94
  _complete_path(Path(target_home), home=env.home_dir),
95
95
  )
96
96
 
97
+ # Initially had "--prune-empty-dirs" to remove directories with no files in the
98
+ # target. But that might break autocreate structures like git repos.
97
99
  base_args = [
98
100
  "--mkpath", # Create target directory if it does not exist.
99
101
  "--recursive", # Recurse into directories.
@@ -111,7 +113,6 @@ def create( # noqa: PLR0915
111
113
  "--times", # Retains modification times (important for quick change check).
112
114
  "--atimes", # Keep access times.
113
115
  "--open-noatime",
114
- "--prune-empty-dirs", # Remove directories with no files in the target.
115
116
  "--out-format", # Set output format to show
116
117
  out_format,
117
118
  ]
@@ -123,8 +124,7 @@ def create( # noqa: PLR0915
123
124
  base_args.extend(
124
125
  (
125
126
  "--fuzzy", # Search for similar files in the target and use matches to
126
- "--fuzzy", # speed up transfers (2x fuzzy = search the full transfer
127
- "--fuzzy", # list).
127
+ "--fuzzy", # speed up transfers (2x = search the full transfer list).
128
128
  )
129
129
  )
130
130
  if cg.mtp_target:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes