<commit_before>.\"
.\" FreeBSD pkg - a next generation package for the installation and maintenance
.\" of non-core utilities.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\"
.\"     @(#)pkg.8
.\" $FreeBSD$
.\"
.Dd May 17, 2014
.Dt PKG-ANNOTATE 8
.Os
.Sh NAME
.Nm "pkg annotate"
.Nd add, modify or delete arbitrary annotations from packages
.Sh SYNOPSIS
.Nm
.Op Fl qy
.Fl A|M
.Op Fl Cgix
.Ar pkg-name
.Ar tag
.Op Ar value
.Nm
.Op Fl qy
.Fl S|D
.Op Fl Cgix
.Ar pkg-name
.Ar tag
.Nm
.Op Fl qy
.Fl a
.Fl A|M
.Ar tag
.Op Ar value
.Nm
.Op Fl qy
.Fl a
.Fl S|D
.Ar tag
.Pp
.Nm
.Op Cm --{quiet,yes}
.Cm --{add|modify}
.Op Cm --{case-sensitive,case-insensitive,glob,regex}
.Ar pkg-name
.Ar tag
.Op Ar value
.Nm
.Op Cm --{quiet,yes}
.Cm --{show|delete}
.Op Cm --{case-sensitive,case-insensitive,glob,regex}
.Ar pkg-name
.Ar tag
.Nm
.Op Cm --{quiet,yes}
.Cm --all
.Cm --{add|modify}
.Ar tag
.Op Ar value
.Nm
.Op Cm --{quiet,yes}
.Cm --all
.Cm --{show|delete}
.Ar tag
.Sh DESCRIPTION
.Nm
is used to add, modify, delete or show package annotations.
These are freeform tag-value pairs which may contain any arbitrary text.
.Ar Tags
must be unique per package, but there is no restriction on what
text
.Ar values
may be attached to them.
.Pp
The
.Ar tag
is always specified on the command line, but when adding or modifying
an annotation, the
.Ar value
may be supplied either on the command line or as a text stream on stdin.
.Sh OPTIONS
The following options are supported by
.Nm :
.Bl -tag -width modify
.It Fl a , Cm --all
Annotate all installed packages.
.It Fl A , Cm --add
The operation is to add a new annotation.
Attempting to add an annotation with a
.Ar tag
that already applies to that package is an error, but this will not
cause
.Nm
to exit before attempting to apply the annotation to all remaining
matched packages.
.It Fl C , Cm --case-sensitive
Make the standard or the regular expression
.Fl ( x )
matching against
.Ar pkg-name
case sensitive.
.It Fl D , Cm --delete
The operation is to delete an annotation.
Only the
.Ar tag
needs to be specified.
Attempting to delete an annotation which does not exist on a package
is an error, but this will not prevent
.Nm
carrying on to delete the annotation from all matched packages.
.It Fl g , Cm --glob
Treat
.Ar pkg-name
as a shell glob pattern.
.It Fl i , Cm --case-insensitive
Make the standard or the regular expression
.Fl ( x )
matching against
.Ar pkg-name
case insensitive.
This is the default, unless modified by setting
.Ev CASE_SENSITIVE_MATCH
to true in
.Pa pkg.conf .
.It Fl M , Cm --modify
The operation is to modify a previously existing annotation.
Functionally, this behaves similarly to
.Fl A
except that it will succeed irrespective of whether the tag already
applies to all the matched packages.
.It Fl q , Cm --quiet
Operate quietly: do not output anything other than confirmatory questions.
.It Fl S , Cm --show
Display the annotation identified by
.Ar tag
for each matched package.
.It Fl x , Cm --regex
Treat
.Ar pkg-name
as a regular expression according to the "modern" or "extended" syntax
of
.Xr re_format 7 .
.It Fl y , Cm --yes
Assume "yes" as the answer to all questions.
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of
.Nm .
See
.Xr pkg.conf 5
for further description.
.Bl -tag -width ".Ev NO_DESCRIPTIONS"
.It Ev PKG_DBDIR
.It Ev DEFAULT_ALWAYS_YES
.It Ev ASSUME_ALWAYS_YES
.It Ev CASE_SENSITIVE_MATCH
.El
.Sh FILES
See
.Xr pkg.conf 5 .
.Sh SEE ALSO
.Xr pkg_printf 3 ,<commit_msg>Add some examples on using annotations<commit_after>.\"
.\" FreeBSD pkg - a next generation package for the installation and maintenance
.\" of non-core utilities.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\"
.\"     @(#)pkg.8
.\" $FreeBSD$
.\"
.Dd May 17, 2014
.Dt PKG-ANNOTATE 8
.Os
.Sh NAME
.Nm "pkg annotate"
.Nd add, modify or delete arbitrary annotations from packages
.Sh SYNOPSIS
.Nm
.Op Fl qy
.Fl A|M
.Op Fl Cgix
.Ar pkg-name
.Ar tag
.Op Ar value
.Nm
.Op Fl qy
.Fl S|D
.Op Fl Cgix
.Ar pkg-name
.Ar tag
.Nm
.Op Fl qy
.Fl a
.Fl A|M
.Ar tag
.Op Ar value
.Nm
.Op Fl qy
.Fl a
.Fl S|D
.Ar tag
.Pp
.Nm
.Op Cm --{quiet,yes}
.Cm --{add|modify}
.Op Cm --{case-sensitive,case-insensitive,glob,regex}
.Ar pkg-name
.Ar tag
.Op Ar value
.Nm
.Op Cm --{quiet,yes}
.Cm --{show|delete}
.Op Cm --{case-sensitive,case-insensitive,glob,regex}
.Ar pkg-name
.Ar tag
.Nm
.Op Cm --{quiet,yes}
.Cm --all
.Cm --{add|modify}
.Ar tag
.Op Ar value
.Nm
.Op Cm --{quiet,yes}
.Cm --all
.Cm --{show|delete}
.Ar tag
.Sh DESCRIPTION
.Nm
is used to add, modify, delete or show package annotations.
These are freeform tag-value pairs which may contain any arbitrary text.
.Ar Tags
must be unique per package, but there is no restriction on what
text
.Ar values
may be attached to them.
.Pp
The
.Ar tag
is always specified on the command line, but when adding or modifying
an annotation, the
.Ar value
may be supplied either on the command line or as a text stream on stdin.
.Sh OPTIONS
The following options are supported by
.Nm :
.Bl -tag -width modify
.It Fl a , Cm --all
Annotate all installed packages.
.It Fl A , Cm --add
The operation is to add a new annotation.
Attempting to add an annotation with a
.Ar tag
that already applies to that package is an error, but this will not
cause
.Nm
to exit before attempting to apply the annotation to all remaining
matched packages.
.It Fl C , Cm --case-sensitive
Make the standard or the regular expression
.Fl ( x )
matching against
.Ar pkg-name
case sensitive.
.It Fl D , Cm --delete
The operation is to delete an annotation.
Only the
.Ar tag
needs to be specified.
Attempting to delete an annotation which does not exist on a package
is an error, but this will not prevent
.Nm
carrying on to delete the annotation from all matched packages.
.It Fl g , Cm --glob
Treat
.Ar pkg-name
as a shell glob pattern.
.It Fl i , Cm --case-insensitive
Make the standard or the regular expression
.Fl ( x )
matching against
.Ar pkg-name
case insensitive.
This is the default, unless modified by setting
.Ev CASE_SENSITIVE_MATCH
to true in
.Pa pkg.conf .
.It Fl M , Cm --modify
The operation is to modify a previously existing annotation.
Functionally, this behaves similarly to
.Fl A
except that it will succeed irrespective of whether the tag already
applies to all the matched packages.
.It Fl q , Cm --quiet
Operate quietly: do not output anything other than confirmatory questions.
.It Fl S , Cm --show
Display the annotation identified by
.Ar tag
for each matched package.
.It Fl x , Cm --regex
Treat
.Ar pkg-name
as a regular expression according to the "modern" or "extended" syntax
of
.Xr re_format 7 .
.It Fl y , Cm --yes
Assume "yes" as the answer to all questions.
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of
.Nm .
See
.Xr pkg.conf 5
for further description.
.Bl -tag -width ".Ev NO_DESCRIPTIONS"
.It Ev PKG_DBDIR
.It Ev DEFAULT_ALWAYS_YES
.It Ev ASSUME_ALWAYS_YES
.It Ev CASE_SENSITIVE_MATCH
.El
.Sh FILES
See
.Xr pkg.conf 5 .
.Sh EXAMPLES
Annotate the nginx package with the tag foo and a value of bar:
.Dl # pkg annotate -A nginx foo bar
.Pp
View all annotations on a package:
.Dl $ pkg info nginx
.Pp
Remove the annotation:
.Dl # pkg annotate -D nginx foo
.Pp
Show all packages with the foo annotation:
.Dl # pkg annotate --all --show foo
.Pp
.\" ---------------------------------------------------------------------------
.Sh SEE ALSO
.Xr pkg_printf 3 ,
{'fraction_non_alphanumeric': 0.0956989247311828, 'fraction_numerical': 0.0033452807646356035, 'mean_word_length': 3.123645320197044, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7348495', 'n_tokens_mistral': 2888, 'n_tokens_neox': 2680, 'n_words': 1347}