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> ...]
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
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
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 ""
.TP
.B dependent [\-\-softdeps] [\-\-all] <package>
Print a list of ports which have
.B dependent [\-\-recursive] [\-\-softdeps] [\-\-all] <package>
Print a list of ports whose "Depends on:" line contains
.B <package>
in their "Depends on:" line. Use the --softdeps flag to also search the
"Optional:" lines for \fB<package>\fP.
(or its dependents, if --recursive is passed). Use the --softdeps flag to also
search the "Optional:" lines for \fB<package>\fP .
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
(without duplication), and --tree to get a nicely indented one.
dependencies, add the --all switch. Use --tree to get a nicely indented list.
.TP
.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'.
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
\ \ \ \(bu
@ -279,6 +279,21 @@ You can customize the output by combining these symbols in other ways.
\ \ \ \(bu
%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
.B list [\-v|\-vv] [\-\-path] [\-\-regex] [filter]
@ -292,7 +307,7 @@ for the list command. Make sure you escape where needed
.TP
.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:
.TP
\ \ \ \(bu
@ -408,15 +423,14 @@ Print out a listing of the port's directory
.TP
.B cat <package> [<file>]
Print out the file to stdout. If <file> is not specified, 'Pkgfile' is used.
If set, uses $PAGER.
Print to stdout (or $PAGER, if set) the contents of <file> in the port's
directory. If <file> is not specified, 'Pkgfile' is used.
.TP
.B edit <package> [<file>]
Edit the file using the editor specified in the $EDITOR environment variable.
If <file> is not specified, 'Pkgfile' is used.
.TP
.B help
Show a help screen
@ -495,7 +509,7 @@ Don't install these packages, even if they're listed as dependencies
.TP
.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.
.TP
@ -510,7 +524,7 @@ Use cache file for this command
.TP
.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
.TP
@ -523,7 +537,15 @@ Execute post-install script if it's there
.TP
.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
.B \-\-install\-root=<dir>
@ -552,7 +574,11 @@ install\fP command, or just copy the desired directives into
.TP
.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
.B \-\-no-std-config
@ -572,7 +598,7 @@ Set <string> in configuration, overriding configuration file
.TP
.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 ""

View File

@ -246,7 +246,7 @@ void PrtGet::listShadowed() {
if (m_parser->otherArgs().size() > 0)
format = *(m_parser->otherArgs().begin());
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;
Package* p1;
@ -264,6 +264,10 @@ void PrtGet::listShadowed() {
StringHelper::replaceAll(output, "%p2", p2->path() + "/" + p2->name());
StringHelper::replaceAll(output, "%v1", p1->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");
cout << output;