From 8d6bc1fc7b14d26589a4789dc9da291ef404bd61 Mon Sep 17 00:00:00 2001 From: Christopher Koch Date: Wed, 23 Jul 2014 00:03:27 +0200 Subject: Support rc files without leading dots This adds the `-U` option to lsrc(1), rcup(1), and rcdn(1) commands; its argument is an exclusion pattern. Any file matching this pattern is symlinked without the leading dot. There is also a `-u` option to undo a `-U`. The `UNDOTTED` setting in rcrc(5) can be used to set it permanently. The mkrc(1) command has `-U` and `-u` flags. They take no argument. --- man/lsrc.1 | 21 +++++++++++++++++++++ man/mkrc.1 | 9 ++++++++- man/rcdn.1 | 25 +++++++++++++++++++++++++ man/rcm.7.mustache | 15 +++++++++++++++ man/rcrc.5 | 13 ++++++++++++- man/rcup.1 | 21 +++++++++++++++++++++ 6 files changed, 102 insertions(+), 2 deletions(-) (limited to 'man') diff --git a/man/lsrc.1 b/man/lsrc.1 index a05dfe8..b63b8a7 100644 --- a/man/lsrc.1 +++ b/man/lsrc.1 @@ -13,6 +13,8 @@ .Op Fl S Ar excl_pat .Op Fl s Ar excl_pat .Op Fl t Ar tag +.Op Fl U Ar excl_pat +.Op Fl u Ar excl_pat .Op Fl x Ar excl_pat .Op files ... .Sh DESCRIPTION @@ -89,6 +91,25 @@ protect it from your shell. .It Fl t Ar TAG list dotfiles according to TAG . +.It Fl U Ar excl_pat +the rc files or directories matching this pattern will not be symlinked or +created with a leading dot. See +.Sx EXCLUDE PATTERN +for more details. This option can be repeated. You may need to quote the +pattern to prevent the shell from swallowing the glob. +. +.It Fl u Ar excl_pat +if an rc file or directory matches the given pattern, it must be dotted. See +.Sx EXCLUDE PATTERN +for more details. This is the opposite of the +.Fl U +option, and can be used to undo it or the +.Va UNDOTTED +setting in your +.Xr rcrc 5 +configuration. This option can be repeated. You may need to quote the +pattern to prevent the shell from swallowing the glob. +. .It Fl V show the version number. . diff --git a/man/mkrc.1 b/man/mkrc.1 index 687c894..9ac11a7 100644 --- a/man/mkrc.1 +++ b/man/mkrc.1 @@ -6,7 +6,7 @@ .Nd bless files into a dotfile managed by rcm .Sh SYNOPSIS .Nm mkrc -.Op Fl ChoqSsVv +.Op Fl ChoqSsVvUu .Op Fl t Ar tag .Op Fl d Ar dir .Op Fl B Ar hostname @@ -46,6 +46,12 @@ in the section This is the default. .It Fl t Ar TAG install dotfiles according to tag +.It Fl U +the specified files or directories are to be installed without a leading +dot. +.It Fl u +the specified files or directories are to be installed with a leading dot. This +is the default. .It Fl v increase verbosity. This can be repeated for extra verbosity. .It Fl V @@ -66,6 +72,7 @@ User configuration file. Defaults to .Dl mkrc -o ~/.rcrc .Dl mkrc -C .ssh .Dl mkrc -S .zpretzo +.Dl mkrc -U bin .Sh SEE ALSO .Xr lsrc 1 , .Xr rcdn 1 , diff --git a/man/rcdn.1 b/man/rcdn.1 index 21261fd..10543e9 100644 --- a/man/rcdn.1 +++ b/man/rcdn.1 @@ -13,6 +13,8 @@ .Op Fl S Ar excl_pat .Op Fl s Ar excl_pat .Op Fl t Ar tag +.Op Fl U Ar excl_pat +.Op Fl u Ar excl_pat .Op Fl x Ar excl_pat .Op Ar files ... .Sh DESCRIPTION @@ -87,6 +89,29 @@ This can be repeated. .It Fl t Ar TAG remove dotfiles according to .Ar TAG +.It Fl U Ar EXCL_PAT +any rc file or directory that matches +.Ar EXCL_PAT +is considered to have been installed without a leading dot when removing them. +Must be specified for rc files or directories that were indeed installed +without a leading dot. This can be repeated. See the +documentation of the +.Fl U +option in +.Xr lsrc 1 +for more information. +.It Fl u Ar EXCL_PAT +any rc file or directory that matches +.Ar EXCL_PAT +is considered to have been installed with a leading dot when removing them. +This is the default, and is the opposite of +.Fl U . +This can be repeated. See the +documentation of the +.Fl u +option in +.Xr lsrc 1 +for more information. .It Fl v increase verbosity. This can be repeated for extra verbosity. .It Fl V diff --git a/man/rcm.7.mustache b/man/rcm.7.mustache index bea7aea..52b2187 100644 --- a/man/rcm.7.mustache +++ b/man/rcm.7.mustache @@ -115,6 +115,21 @@ in .Pp .Dl rcup -d configs -v . +.Ss COMMON PROBLEM: CONFIGURATION FILES/DIRECTORIES WITHOUT DOTS +By default, the rcm suite will prefix every file and directory it manages +with a dot. If that is not desired, for example in the case of +.Pa ~/bin +or +.Pa ~/texmf , +you can add that file or directory to +.Ev UNDOTTED +in +.Xr rcrc 5 +or use the +.Fl U +option. For example: +.Dl mkrc -U bin +. .Sh QUICK START FOR EMPTY DOTFILES DIRECTORIES This section is for those who do not have an existing dotfiles directory and whose dotfiles are standard. diff --git a/man/rcrc.5 b/man/rcrc.5 index bc72329..78451f4 100644 --- a/man/rcrc.5 +++ b/man/rcrc.5 @@ -60,6 +60,16 @@ symlinked instead of descended. Patterns are explained in detail in under the section .Sx EXCLUDE PATTERN . . +.It Va UNDOTTED +a space separated list of patterns. Files matching this pattern +will be symlinked without a leading dot. If a file is also in +.Va SYMLINK_DIRS , +then the directory will be symlinked without a leading dot. +Patterns are explained in detail in +.Xr lsrc 1 +under the section +.Sx EXCLUDE PATTERN . +. .El .Sh FILES .Pa ~/.rcrc @@ -70,7 +80,8 @@ under the section .Dl EXCLUDES="irbrc *:*emacs* dotfiles:python*" .Dl HOSTNAME="eggplant" .Dl TAGS="freebsd development email git laptop gmail notmuch" -.Dl SYMLINK_DIRS="zprezto" +.Dl SYMLINK_DIRS="zprezto texmf" +.Dl UNDOTTED="texmf" .Sh SEE ALSO .Xr lsrc 1 , .Xr mkrc 1 , diff --git a/man/rcup.1 b/man/rcup.1 index 130ae4a..82c0293 100644 --- a/man/rcup.1 +++ b/man/rcup.1 @@ -14,6 +14,8 @@ .Op Fl S Ar excl_pat .Op Fl s Ar excl_pat .Op Fl t Ar tag +.Op Fl U Ar excl_pat +.Op Fl u Ar excl_pat .Op Fl x Ar excl_pat .Op Ar files ... .Sh DESCRIPTION @@ -91,6 +93,25 @@ This option can be repeated. .It Fl t Ar TAG install dotfiles according to .Ar TAG +.It Fl U Ar EXCL_PAT +any rc file that matches +.Ar EXCL_PAT +is installed without a leading dot. This option can be repeated. See the +documentation of the +.Fl U +option in +.Xr lsrc 1 +for more information. +.It Fl u Ar EXCL_PAT +any rc file that matches +.Ar EXCL_PAT +is installed with a leading dot. This is the opposite of +.Fl U . +This option can be repeated. This is the default. See the documentation of the +.Fl u +option in +.Xr lsrc 1 +for more information. .It Fl q decrease verbosity .It Fl V -- cgit v1.2.3