Changeset View
Changeset View
Standalone View
Standalone View
swh/model/cli.py
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | @click.option('--dereference/--no-dereference', 'follow_symlinks', | ||||
+ '(default: follow)') | + '(default: follow)') | ||||
@click.option('--filename/--no-filename', 'show_filename', default=True, | @click.option('--filename/--no-filename', 'show_filename', default=True, | ||||
help='show/hide file name (default: show)') | help='show/hide file name (default: show)') | ||||
@click.option('--type', '-t', 'obj_type', default='auto', | @click.option('--type', '-t', 'obj_type', default='auto', | ||||
type=click.Choice(['auto', 'content', 'directory']), | type=click.Choice(['auto', 'content', 'directory']), | ||||
help='type of object to identify (default: auto)') | help='type of object to identify (default: auto)') | ||||
@click.option('--verify', '-v', metavar='PID', type=PidParamType(), | @click.option('--verify', '-v', metavar='PID', type=PidParamType(), | ||||
help='reference identifier to be compared with computed one') | help='reference identifier to be compared with computed one') | ||||
@click.argument('objects', nargs=-1, | @click.argument('objects', nargs=-1, required=True, | ||||
type=click.Path(exists=True, readable=True, | type=click.Path(exists=True, readable=True, | ||||
allow_dash=True, path_type=bytes)) | allow_dash=True, path_type=bytes)) | ||||
def identify(obj_type, verify, show_filename, follow_symlinks, objects): | def identify(obj_type, verify, show_filename, follow_symlinks, objects): | ||||
"""Compute the Software Heritage persistent identifier (PID) for the given | """Compute the Software Heritage persistent identifier (PID) for the given | ||||
source code object(s). | source code object(s). | ||||
For more details about Software Heritage PIDs see: | For more details about Software Heritage PIDs see: | ||||
Show All 40 Lines |