Skip to content

Commit

Permalink
🤸‍♀️ mommy now supports -d option as an alias~
Browse files Browse the repository at this point in the history
  • Loading branch information
FWDekker committed Mar 8, 2024
1 parent e61af24 commit 5e59939
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog
## [unreleased]
### added
* 🤸‍♀️ mommy now supports `-d` as an alias of `--global-config-dirs`~


## [1.5.0] -- 2024-02-28
### added
* 🦓 mommy now supports templates with literal slashes using `%%S%%`~ ([#107](https://github.com/FWDekker/mommy/issues/107))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ additionally, mommy knows a few extra options, which you can use to discover who
| `-v` | `--version` | displays mommy's version information~ |
| `-1` | | writes output to stdout instead of stderr~ |
| `-c <file>` | `--config=<file>` | tells mommy that she should read your [config](#configuration) from `<file>`~ |
| | `--global-config-dirs=<dirs>` | sets [global configuration dirs](#config-file-locations) to the colon-separated list in `<dirs>`~ |
| `-d <dirs>` | `--global-config-dirs=<dirs>` | sets [global configuration dirs](#config-file-locations) to the colon-separated list in `<dirs>`~ |


## 🙋 configuration<a name="configuration"></a> <small><sup>[top ▲](#toc)</sup></small>
Expand Down
2 changes: 1 addition & 1 deletion src/main/completions/fish/mommy.fish
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ complete --command mommy --short-option c --long-option config \
--description "Configuration file" \
--condition "not __fish_seen_argument $opt_help $opt_version"\
--condition "test -z (get_args)"
complete --command mommy --long-option global-config-dirs \
complete --command mommy --short-option d --long-option global-config-dirs \
--require-parameter \
--arguments "(__fish_complete_directories)" \
--description "Colon-separated global config file dirs" \
Expand Down
2 changes: 1 addition & 1 deletion src/main/completions/zsh/_mommy
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ _arguments \
"(- *)"{-v,--version}'[Show version]' \
-1'[Write to stdout]' \
{-c,--config}'[Configuration file]:config:_files' \
--global-config-dirs'[Colon-separated global config file dirs]:global config:_dir_list' \
{-d,--global-config-dirs}'[Colon-separated global config file dirs]:global config:_dir_list' \
{-e,--eval}'[Evaluate string]:string' \
{-s,--status}'[Exit code]:code:->status' \
'*::command:'
Expand Down
6 changes: 3 additions & 3 deletions src/main/man/man1/mommy.1
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ note that \fIcommand\fP should be given as a single argument~
\fB-s\fP \fIstatus\fP, \fB--status=\fP\fIstatus\fP
gives output corresponding to exit code \fIstatus\fP~
.TP
\fB-d\fP \fIdirs\fP, \fB--global-config-dirs=\fP\fIdirs\fP
sets global configuration dirs to the colon-separated list in \fIdirs\fP~
.TP
\fB-c\fP \fIfile\fP, \fB--config=\fP\fIfile\fP
tells mommy that she should read your config from \fIfile\fP~
.TP
\fB--global-config-dirs=\fP\fIdirs\fP
sets global configuration dirs to the colon-separated list in \fIdirs\fP~
.TP
\fB-1\fP
writes output to \fBstdout\fP instead of \fBstderr\fP~

Expand Down
4 changes: 2 additions & 2 deletions src/main/sh/mommy
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ opt_global_config_dirs="${XDG_CONFIG_DIRS}:/etc/mommy/:/usr/local/etc/mommy/"
opt_eval=""
opt_status=""

while getopts ":hv1c:e:s:-:" OPT; do
while getopts ":hv1d:c:e:s:-:" OPT; do
# Cheap workaround for long options, cf. https://stackoverflow.com/a/28466267
if [ "-" = "$OPT" ]; then
OPT="${OPTARG%%=*}"
Expand All @@ -323,7 +323,7 @@ while getopts ":hv1c:e:s:-:" OPT; do
h|help) opt_help="1" ;;
v|version) opt_version="1" ;;
1) opt_target="1" ;;
global-config-dirs) require_arg; opt_global_config_dirs="$OPTARG" ;;
d|global-config-dirs) require_arg; opt_global_config_dirs="$OPTARG" ;;
c|config) opt_config="$OPTARG" ;;
e|eval) require_arg; opt_eval="$OPTARG" ;;
s|status) require_arg; require_int; opt_status="$OPTARG" ;;
Expand Down

0 comments on commit 5e59939

Please sign in to comment.