<commit_before>.Dd April 1, 2009
.Dt showpath 1 LOCAL
.Os Generic Unix
.Sh NAME
.Nm showpath
.Nd manageably edit path
.Sh SYNOPSIS
.Nm showpath
.Op Fl t Ar type | Fl v Ar ENV_NAME
.Op Fl s Ar separator
.Ar path_entry ...
.Sh DESCRIPTION
The showpath tool writes a string suitable for use as a path
to stdout.
The string is constructed by combining the path entries given on
the command line, in order, with duplicates pruned.
.Pp
Every path_entry is treated as a fragment of a path and is broken
down into its constituent parts by splitting at the separators;
these parts will be added (subject to duplicate pruning) independently.
(This will do The Right Thing with entries without separators, but
see
.Sx BUGS
below.)
.Pp
The magic path_entry
.Li %current
is expanded to the current value of the path (taken from the environment),
before splitting at separators.
.Pp
The following options are available:
.Bl -tag -offset indent
.It Fl s Ar separator
Specifies the path separator.
The separator must be a single character and defaults to ':'.
.It Fl t Ar type
Specifies a pre-configured path type.
Valid types are currently compiled in; making them configurable (by system
and/or user configuration) is a feature scheduled for implementation in
the near future.
.Pp
Currently known types are:
.Bl -tag -compact
.It Li exec
(for
.Li $PATH )
.It Li man
(for
.Li $MANPATH )
.El
.Pp
The
.Fl t
option currently only provides a shorthand for an equivalent use of the
.Fl v
option.
Adding short names for sets of path entries is a feature scheduled
for implementation in the near future; when this happens, specifying
a type will also select a set of short names based on the type.
.It Fl v Ar ENV_NAME
Specifies an environment variable name to look up for the expansion of
.Li %current .
.El
.Pp
The
.Fl t
and
.Fl v
options are mutually exclusive, and at most one of either can be specified.
Specifying neither is equivalent to specifying
.Fl t Li exec .
.Sh FILES
None yet.
.Sh EXAMPLES
Put
.Li $HOME/bin
at the beginning of
.Li $PATH ,
or move it to the beginning if it's already in there somewhere:
.Bd -literal -offset indent -compact
PATH="\*(gashowpath ~/bin %current\*(ga"
.Ed
.Pp
Tell gcc to use header and library files from Macports,
without clobbering existing values of the environment
variables used:
.Bd -literal -offset indent -compact
C_INCLUDE_PATH="\*(gashowpath -vC_INCLUDE_PATH %current /opt/local/include\*(ga"
LIBRARY_PATH="\*(gashowpath -vLIBRARY_PATH %current /opt/local/lib\*(ga"
export C_INCLUDE_PATH LIBRARY_PATH
.Ed
.Pp
Invoke a setup script that adds entries to $PATH, but force new
entries to go at the end instead of the beginning:
.Bd -literal -offset indent -compact
oldpath="$PATH"
\&. /path/to/setup/script
PATH="\*(gashowpath "$oldpath" %current\*(ga"
.Ed
.Sh AUTHORS
.An "<NAME>" Aq <EMAIL>
.An "<NAME>" Aq <EMAIL>
.Sh BUGS
.Fl v
does not control verbosity; this may confuse users, and
therefore may be changed at some point in the future.
.Pp
Empty entries are discarded by strtok when breaking down the string
into its constituent parts.
If you really want an empty path entry, give yourself a whack with
the cluestick and then say
.Li PATH="\*(gashowpath %current\*(ga:" .
.Pp
Send new bug reports to 
.Aq <EMAIL> .<commit_msg>Used more specific markup for various elements, based on a read through the mdoc man page<commit_after>.Dd April 1, 2009
.Dt showpath 1 LOCAL
.Os Generic Unix
.Sh NAME
.Nm showpath
.Nd manageably edit path
.Sh SYNOPSIS
.Nm showpath
.Op Fl t Ar type | Fl v Ar ENV_NAME
.Op Fl s Ar separator
.Ar path_entry ...
.Sh DESCRIPTION
The showpath tool writes a string suitable for use as a path
to stdout.
The string is constructed by combining the path entries given on
the command line, in order, with duplicates pruned.
.Pp
Every path_entry is treated as a fragment of a path and is broken
down into its constituent parts by splitting at the separators;
these parts will be added (subject to duplicate pruning) independently.
(This will do The Right Thing with entries without separators, but
see
.Sx BUGS
below.)
.Pp
The magic path_entry
.Ql %current
is expanded to the current value of the path (taken from the environment),
before splitting at separators.
.Pp
The following options are available:
.Bl -tag -offset indent
.It Fl s Ar separator
Specifies the path separator.
The separator must be a single character and defaults to
.Ql \&: .
.It Fl t Ar type
Specifies a pre-configured path type.
Valid types are currently compiled in; making them configurable (by system
and/or user configuration) is a feature scheduled for implementation in
the near future.
.Pp
Currently known types are:
.Bl -tag -compact
.It Li exec
(for
.Ev $PATH )
.It Li man
(for
.Ev $MANPATH )
.El
.Pp
The
.Fl t
option currently only provides a shorthand for an equivalent use of the
.Fl v
option.
Adding short names for sets of path entries is a feature scheduled
for implementation in the near future; when this happens, specifying
a type will also select a set of short names based on the type.
.It Fl v Ar ENV_NAME
Specifies an environment variable name to look up for the expansion of
.Ql %current .
.El
.Pp
The
.Fl t
and
.Fl v
options are mutually exclusive, and at most one of either can be specified.
Specifying neither is equivalent to specifying
.Fl t Li exec .
.Sh FILES
None yet.
.Sh EXAMPLES
Put
.Pa ~/bin
at the beginning of
.Ev $PATH ,
or move it to the beginning if it's already in there somewhere:
.Bd -literal -offset indent -compact
PATH="\*(gashowpath ~/bin %current\*(ga"
.Ed
.Pp
Tell gcc to use header and library files from Macports,
without clobbering existing values of the environment
variables used:
.Bd -literal -offset indent -compact
C_INCLUDE_PATH="\*(gashowpath -vC_INCLUDE_PATH %current /opt/local/include\*(ga"
LIBRARY_PATH="\*(gashowpath -vLIBRARY_PATH %current /opt/local/lib\*(ga"
export C_INCLUDE_PATH LIBRARY_PATH
.Ed
.Pp
Invoke a setup script that adds entries to
.Ev $PATH ,
but force new entries to go at the end instead of the beginning:
.Bd -literal -offset indent -compact
oldpath="$PATH"
\&. /path/to/setup/script
PATH="\*(gashowpath "$oldpath" %current\*(ga"
.Ed
.Sh AUTHORS
.An "<NAME>" Aq <EMAIL>
.An "<NAME>" Aq <EMAIL>
.Sh BUGS
.Fl v
does not control verbosity; this may confuse users, and
therefore may be changed at some point in the future.
.Pp
Empty entries are discarded by strtok when breaking down the string
into its constituent parts.
If you really want an empty path entry, give yourself a whack with
the cluestick and then say
.Ql PATH="\*(gashowpath %current\*(ga:" .
.Pp
Send new bug reports to 
.Aq <EMAIL> .
{'fraction_non_alphanumeric': 0.07099606418407509, 'fraction_numerical': 0.0018165304268846503, 'mean_word_length': 3.978899773926149, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2787067', 'n_tokens_mistral': 2092, 'n_tokens_neox': 1990, 'n_words': 1057}