logo

utils-std

Collection of commonly available Unix tools
commit: 08613db939d01cdc15963e084e36696929917317
parent 2eecdbaad34600bb6004ba646fd530121d174cda
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu, 11 Jul 2024 21:40:12 +0200

cmd/install: Add ignored -C for compatibility

Diffstat:

Mcmd/install.16++++--
Mcmd/install.c9++++++---
2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/cmd/install.1 b/cmd/install.1 @@ -9,14 +9,14 @@ .Nd install binairies .Sh SYNOPSIS .Nm -.Op Fl cDpT +.Op Fl CcDpT .Op Fl g Ar group .Op Fl m Ar mode .Op Fl o Ar owner .Ar source... .Ar destination .Nm -.Op Fl cDpT +.Op Fl CcDpT .Op Fl g Ar group .Op Fl m Ar mode .Op Fl o Ar owner @@ -47,6 +47,8 @@ is set to 755 unless is specified. .Sh OPTIONS .Bl -tag -width _o_owner +.It Fl C +Ignored, for compatibility with other implementations. .It Fl c Copy the file, default behavior in all modern implementations. .It Fl d diff --git a/cmd/install.c b/cmd/install.c @@ -187,8 +187,8 @@ static void usage() { fprintf(stderr, "\ -Usage: install [-cDpT] [-g group] [-m mode] [-o owner] source... destination\n\ - install [-cDpT] [-g group] [-m mode] [-o owner] -t destination source...\n\ +Usage: install [-CcDpT] [-g group] [-m mode] [-o owner] source... destination\n\ + install [-CcDpT] [-g group] [-m mode] [-o owner] -t destination source...\n\ install -d [-c] [-g group] [-m mode] [-o owner] directory...\n\ "); } @@ -205,10 +205,13 @@ main(int argc, char *argv[]) umask(mkdir_parents_filemask); int c = -1; - while((c = getopt(argc, argv, ":cDdpTt:g:m:o:")) != -1) + while((c = getopt(argc, argv, ":CcDdpTt:g:m:o:")) != -1) { switch(c) { + case 'C': + // ignore, for compatibility + break; case 'c': // ignore, modern default behavior break;