@@ -77,6 +77,10 @@ CHANGES_POSSIBLE=0
77
77
# 0: skip auto_bootstrap, 1: ask, 2: perform bootstrap, 3: prevent bootstrap
78
78
DO_BOOTSTRAP=0
79
79
80
+ # flag to indicate if the program should be quiet or not
81
+ # YES: be quiet, NO: be more noisy
82
+ QUIET=" NO"
83
+
80
84
function main() {
81
85
82
86
require_git
@@ -120,7 +124,7 @@ function main() {
120
124
-a) # used by list()
121
125
LIST_ALL=" YES"
122
126
;;
123
- -d) # used by all commands
127
+ -d|--debug ) # used by all commands
124
128
DEBUG=" YES"
125
129
;;
126
130
-f) # used by init(), clone() and upgrade()
@@ -130,6 +134,9 @@ function main() {
130
134
DO_LIST=" YES"
131
135
[[ " $YADM_COMMAND " =~ ^(clone| config)$ ]] && YADM_ARGS+=(" $1 " )
132
136
;;
137
+ -q|--quiet) # used by all commands
138
+ QUIET=" YES"
139
+ ;;
133
140
-w) # used by init() and clone()
134
141
YADM_WORK=" $( qualify_path " $2 " " work tree" ) "
135
142
shift
@@ -246,7 +253,7 @@ function score_file() {
246
253
record_template " $tgt " " $cmd " " $src "
247
254
else
248
255
debug " No supported template processor for template $src "
249
- [ -n " $loud " ] && echo " No supported template processor for template $src "
256
+ [ " $QUIET " = " NO " ] && echo " No supported template processor for template $src "
250
257
fi
251
258
return 0
252
259
# unsupported values
@@ -560,10 +567,6 @@ function alt() {
560
567
local local_distro_family
561
568
set_local_alt_values
562
569
563
- # only be noisy if the "alt" command was run directly
564
- local loud=
565
- [ " $YADM_COMMAND " = " alt" ] && loud=" YES"
566
-
567
570
# decide if a copy should be done instead of a symbolic link
568
571
local do_copy=0
569
572
[ " $( config --bool yadm.alt-copy) " == " true" ] && do_copy=1
@@ -708,7 +711,7 @@ function alt_linking() {
708
711
if [ -n " $template_cmd " ]; then
709
712
# a template is defined, process the template
710
713
debug " Creating $tgt from template $src "
711
- [ -n " $loud " ] && echo " Creating $tgt from template $src "
714
+ [ " $QUIET " = " NO " ] && echo " Creating $tgt from template $src "
712
715
# ensure the destination path exists
713
716
assert_parent " $tgt "
714
717
# remove any existing symlink before processing template
@@ -717,7 +720,7 @@ function alt_linking() {
717
720
elif [ -n " $src " ]; then
718
721
# a link source is defined, create symlink
719
722
debug " Linking $src to $tgt "
720
- [ -n " $loud " ] && echo " Linking $src to $tgt "
723
+ [ " $QUIET " = " NO " ] && echo " Linking $src to $tgt "
721
724
# ensure the destination path exists
722
725
assert_parent " $tgt "
723
726
if [ " $do_copy " -eq 1 ]; then
@@ -1174,6 +1177,11 @@ Commands:
1174
1177
yadm git-crypt [OPTIONS] - Run git-crypt commands for the yadm repo
1175
1178
yadm transcrypt [OPTIONS] - Run transcrypt commands for the yadm repo
1176
1179
1180
+ General Options:
1181
+ --help - Display this help message
1182
+ -d, --debug - Enable debug output
1183
+ -q, --quiet - Suppress output
1184
+
1177
1185
Files:
1178
1186
\$ HOME/.config/yadm/config - yadm's configuration file
1179
1187
\$ HOME/.config/yadm/encrypt - List of globs to encrypt/decrypt
0 commit comments