Commit 2d8177d6 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

Merge branch 'improve_docs' into 'main'

Updates to docs and typo fixes

See merge request thht/plus_sync!7
parents 2b0acf33 028b9be8
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1815,9 +1815,9 @@ packages:
  timestamp: 1713667175451
- kind: pypi
  name: plus-sync
  version: 0.1.1.dev7+g2bf7ada
  version: 0.2.1.dev2+g00c86c8.d20240717
  path: .
  sha256: ffe7fec1ecb45d785e5651831378ba52a601a34a54898171d6b6a80f03f917a1
  sha256: 116b826c86415024379cd9caf96c930d62e6b7aba9d24fae588a58628a9d2439
  requires_dist:
  - attrs
  - attrs-strict
+2 −10
Original line number Diff line number Diff line
@@ -4,20 +4,12 @@ import typer

from ...config import Config
from ..app import app
from ..helpers.typer import get_hashed_default
from ..helpers.typer import HashSubjectIDs


@app.command()
def list_subjects(
    remote_name: Annotated[str, typer.Argument(help='The name of the remote')],
    hash_subject_ids: Annotated[
        bool,
        typer.Option(
            help='Whether to hash the subject IDs. Overrides the `has_subject_ids` setting.',
            default_factory=get_hashed_default,
            show_default=False,
        ),
    ],
    remote_name: Annotated[str, typer.Argument(help='The name of the remote')], hash_subject_ids: HashSubjectIDs()
):
    """
    List the subjects in a sync endpoint.
+2 −9
Original line number Diff line number Diff line
@@ -4,20 +4,13 @@ import typer

from ...config import Config
from ..app import app
from ..helpers.typer import get_hashed_default
from ..helpers.typer import HashSubjectIDs


@app.command(no_args_is_help=True)
def ls(
    remote_name: Annotated[str, typer.Argument(help='The name of the remote to use.')],
    hash_subject_ids: Annotated[
        bool,
        typer.Option(
            help='Whether to hash the subject IDs. Overrides the `has_subject_ids` setting.',
            default_factory=get_hashed_default,
            show_default=False,
        ),
    ],
    hash_subject_ids: HashSubjectIDs(),
):
    """
    List the files that are available.
+2 −9
Original line number Diff line number Diff line
@@ -6,20 +6,13 @@ from tqdm import tqdm

from ...config import Config
from ..app import app
from ..helpers.typer import get_hashed_default
from ..helpers.typer import HashSubjectIDs


@app.command(no_args_is_help=True)
def sync(
    remote_name: Annotated[str, typer.Argument(help='The name of the remote to use.')],
    hash_subject_ids: Annotated[
        bool,
        typer.Option(
            help='Whether to hash the subject IDs. Overrides the `has_subject_ids` setting.',
            default_factory=get_hashed_default,
            show_default=False,
        ),
    ],
    hash_subject_ids: HashSubjectIDs(),
    dry_run: Annotated[bool, typer.Option(help='Whether to do a dry run.')] = False,
    limit: Annotated[int, typer.Option(help='Limit the number of subjects to sync.')] = None,
):
+15 −0
Original line number Diff line number Diff line
from typing import Annotated

import typer

from plus_sync.config import Config


def get_hashed_default() -> bool:
    config = Config.from_cmdargs()
    return config.hash_subject_ids


def HashSubjectIDs():  # noqa: N802
    return Annotated[
        bool,
        typer.Option(
            help='Whether to hash the subject IDs. Overrides the `hash_subject_ids` setting.',
            default_factory=get_hashed_default,
            show_default=False,
        ),
    ]
Loading