support more format codes in the argument to 'dup'

expand man-page to explain some asymmetries
This commit is contained in:
John McQuah 2023-06-23 11:46:46 -04:00
parent 06b1599c8c
commit 68239f077b
2 changed files with 48 additions and 18 deletions

View File

@ -78,7 +78,7 @@ non-option argument passed. This is very similar to
.B install [\-\-margs] [\-\-aargs] [\-\-log] [\-\-nodeps] [\-\-softdeps] <package1> [<package2> ...] .B install [\-\-margs] [\-\-aargs] [\-\-log] [\-\-nodeps] [\-\-softdeps] <package1> [<package2> ...]
Install or update the packages given on the command line. Note that you can do Install or update the packages given on the command line. Note that you can do
this from any directory. Pass the --nodeps flag to prevent \fBprt\-get\fP from this from any directory. Pass the --nodeps flag to prevent \fBprt\-get\fP from
resolving dependencies and injecting any needed ports into the list of targets. resolving dependencies and injecting any needed packages into the list of targets.
Pass the --softdeps flag if you want the dependency resolver to also consider Pass the --softdeps flag if you want the dependency resolver to also consider
the "Optional" relationships among the packages given on the command line. the "Optional" relationships among the packages given on the command line.
@ -236,15 +236,14 @@ order to show them all, add the --all switch.
.SH "" .SH ""
.TP .TP
.B dependent [\-\-softdeps] [\-\-all] <package> .B dependent [\-\-recursive] [\-\-softdeps] [\-\-all] <package>
Print a list of ports which have Print a list of ports whose "Depends on:" line contains
.B <package> .B <package>
in their "Depends on:" line. Use the --softdeps flag to also search the (or its dependents, if --recursive is passed). Use the --softdeps flag to also
"Optional:" lines for \fB<package>\fP. search the "Optional:" lines for \fB<package>\fP .
By default, output is restricted to ports that are installed. To see all the By default, output is restricted to ports that are installed. To see all the
dependencies, add the --all switch; use --recursive to get a recursive list dependencies, add the --all switch. Use --tree to get a nicely indented list.
(without duplication), and --tree to get a nicely indented one.
.TP .TP
.B dup [-v] [format] .B dup [-v] [format]
@ -257,7 +256,8 @@ particular combination of the recognized format symbols, namely
.B '* %n\en %p1 %v1 precedes over\en %p2 %v2\en'. .B '* %n\en %p1 %v1 precedes over\en %p2 %v2\en'.
You can customize the output by combining these symbols in other ways. You can customize the output by passing a different format string, whose
symbols will be replaced as follows.
.TP .TP
\ \ \ \(bu \ \ \ \(bu
@ -279,6 +279,21 @@ You can customize the output by combining these symbols in other ways.
\ \ \ \(bu \ \ \ \(bu
%v2 \-> version of port being hidden %v2 \-> version of port being hidden
.TP
\ \ \ \(bu
%M1 \-> maintainer of port taking precedence
.TP
\ \ \ \(bu
%M2 \-> maintainer of port being hidden
.TP
\ \ \ \(bu
%u1 \-> URL of port taking precedence
.TP
\ \ \ \(bu
%u2 \-> URL of port being hidden
.TP .TP
.B list [\-v|\-vv] [\-\-path] [\-\-regex] [filter] .B list [\-v|\-vv] [\-\-path] [\-\-regex] [filter]
@ -292,7 +307,7 @@ for the list command. Make sure you escape where needed
.TP .TP
.B printf <format string1> [\-\-sort=<format string2>] [\-\-filter=<filter>] .B printf <format string1> [\-\-sort=<format string2>] [\-\-filter=<filter>]
Print formatted port list format string can contain variables, which Print formatted port list. Format string can contain variables, which
are replaced like this: are replaced like this:
.TP .TP
\ \ \ \(bu \ \ \ \(bu
@ -408,15 +423,14 @@ Print out a listing of the port's directory
.TP .TP
.B cat <package> [<file>] .B cat <package> [<file>]
Print out the file to stdout. If <file> is not specified, 'Pkgfile' is used. Print to stdout (or $PAGER, if set) the contents of <file> in the port's
If set, uses $PAGER. directory. If <file> is not specified, 'Pkgfile' is used.
.TP .TP
.B edit <package> [<file>] .B edit <package> [<file>]
Edit the file using the editor specified in the $EDITOR environment variable. Edit the file using the editor specified in the $EDITOR environment variable.
If <file> is not specified, 'Pkgfile' is used. If <file> is not specified, 'Pkgfile' is used.
.TP .TP
.B help .B help
Show a help screen Show a help screen
@ -495,7 +509,7 @@ Don't install these packages, even if they're listed as dependencies
.TP .TP
.B \-\-nodeps .B \-\-nodeps
Leave the list of requested ports as-is, without sorting by dependencies Leave the list of requested packages as-is, without sorting by dependencies
or injecting missing dependencies. or injecting missing dependencies.
.TP .TP
@ -510,7 +524,7 @@ Use cache file for this command
.TP .TP
.B \-\-test .B \-\-test
Dry run, don't actually install anything, mostly interesting for Dry run, don't actually install anything. Mostly interesting for
.B prt\-get install, prt\-get update, prt\-get sysup .B prt\-get install, prt\-get update, prt\-get sysup
.TP .TP
@ -523,7 +537,15 @@ Execute post-install script if it's there
.TP .TP
.B \-\-install\-scripts .B \-\-install\-scripts
Execute pre-install and post-install script if they're there Execute pre-install and post-install script if they're there.
The options --pre-install, --post-install, and --install-scripts offer a
convenient way to temporarily override the prt-get.conf directive 'runscripts
no', which was the historical default. Starting with CRUX 3.7, prt-get.conf is
being shipped with 'runscripts yes'. To override this default at the command
line, you have to pass the more cumbersome option --config-set=\(dqrunscripts
no\(dq, or point prt-get to an alternative configuration file using
--config=<file>. (see below for the documentation of these options)
.TP .TP
.B \-\-install\-root=<dir> .B \-\-install\-root=<dir>
@ -552,7 +574,11 @@ install\fP command, or just copy the desired directives into
.TP .TP
.B \-\-log .B \-\-log
Write build output to log file Write build output to log file. Basically a convenient alias for
\fB\-\-config\-set=\(dqwritelog enabled\(dq\fP. Note that there is no similar
alias allowing you to temporarily override the configuration directive
\(dqwritelog enabled\(dq; you have to resort to \fB\-\-config\-set=\(dqwritelog
disabled\(dq\fP if that is your intention.
.TP .TP
.B \-\-no-std-config .B \-\-no-std-config
@ -572,7 +598,7 @@ Set <string> in configuration, overriding configuration file
.TP .TP
.B \-\-config=<file> .B \-\-config=<file>
Use alternative configuration file to read ports directories from Use <file> to read configuration directives, rather than /etc/prt-get.conf.
.SH "" .SH ""

View File

@ -246,7 +246,7 @@ void PrtGet::listShadowed() {
if (m_parser->otherArgs().size() > 0) if (m_parser->otherArgs().size() > 0)
format = *(m_parser->otherArgs().begin()); format = *(m_parser->otherArgs().begin());
else if (m_parser->verbose() > 0) else if (m_parser->verbose() > 0)
format = "* %n\n %p1 %v1 preceeds over \n %p2 %v2\n"; format = "* %n\n %p1 %v1 precedes over \n %p2 %v2\n";
string output; string output;
Package* p1; Package* p1;
@ -264,6 +264,10 @@ void PrtGet::listShadowed() {
StringHelper::replaceAll(output, "%p2", p2->path() + "/" + p2->name()); StringHelper::replaceAll(output, "%p2", p2->path() + "/" + p2->name());
StringHelper::replaceAll(output, "%v1", p1->versionReleaseString()); StringHelper::replaceAll(output, "%v1", p1->versionReleaseString());
StringHelper::replaceAll(output, "%v2", p2->versionReleaseString()); StringHelper::replaceAll(output, "%v2", p2->versionReleaseString());
StringHelper::replaceAll(output, "%M1", p1->maintainer());
StringHelper::replaceAll(output, "%M2", p2->maintainer());
StringHelper::replaceAll(output, "%u1", p1->url());
StringHelper::replaceAll(output, "%u2", p2->url());
StringHelper::replaceAll(output, "\\n", "\n"); StringHelper::replaceAll(output, "\\n", "\n");
cout << output; cout << output;