Changeset View
Changeset View
Standalone View
Standalone View
swh/model/cli.py
Show First 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | |||||
) | ) | ||||
@click.option( | @click.option( | ||||
"--exclude", | "--exclude", | ||||
"-x", | "-x", | ||||
"exclude_patterns", | "exclude_patterns", | ||||
metavar="PATTERN", | metavar="PATTERN", | ||||
multiple=True, | multiple=True, | ||||
help="Exclude directories using glob patterns \ | help="Exclude directories using glob patterns \ | ||||
(e.g., '*.git' to exclude all .git directories)", | (e.g., ``*.git`` to exclude all .git directories)", | ||||
) | ) | ||||
@click.option( | @click.option( | ||||
"--verify", | "--verify", | ||||
"-v", | "-v", | ||||
metavar="SWHID", | metavar="SWHID", | ||||
type=CoreSWHIDParamType(), | type=CoreSWHIDParamType(), | ||||
help="reference identifier to be compared with computed one", | help="reference identifier to be compared with computed one", | ||||
) | ) | ||||
@click.argument("objects", nargs=-1, required=True) | @click.argument("objects", nargs=-1, required=True) | ||||
def identify( | def identify( | ||||
obj_type, verify, show_filename, follow_symlinks, objects, exclude_patterns, | obj_type, verify, show_filename, follow_symlinks, objects, exclude_patterns, | ||||
): | ): | ||||
"""Compute the Software Heritage persistent identifier (SWHID) for the given | """Compute the Software Heritage persistent identifier (SWHID) for the given | ||||
source code object(s). | source code object(s). | ||||
For more details about SWHIDs see: | For more details about SWHIDs see: | ||||
\b | \b | ||||
https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html | https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html | ||||
Tip: you can pass "-" to identify the content of standard input. | Tip: you can pass "-" to identify the content of standard input. | ||||
\b | \b | ||||
Examples: | Examples:: | ||||
\b | \b | ||||
$ swh identify fork.c kmod.c sched/deadline.c | $ swh identify fork.c kmod.c sched/deadline.c | ||||
swh:1:cnt:2e391c754ae730bd2d8520c2ab497c403220c6e3 fork.c | swh:1:cnt:2e391c754ae730bd2d8520c2ab497c403220c6e3 fork.c | ||||
swh:1:cnt:0277d1216f80ae1adeed84a686ed34c9b2931fc2 kmod.c | swh:1:cnt:0277d1216f80ae1adeed84a686ed34c9b2931fc2 kmod.c | ||||
swh:1:cnt:57b939c81bce5d06fa587df8915f05affbe22b82 sched/deadline.c | swh:1:cnt:57b939c81bce5d06fa587df8915f05affbe22b82 sched/deadline.c | ||||
\b | \b | ||||
Show All 40 Lines |