Skip to content

Commit

Permalink
support option -q (quiet)
Browse files Browse the repository at this point in the history
  • Loading branch information
mle86 committed Jan 19, 2020
1 parent 8499aca commit a32a337
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#### next (January 2020)

- Set safe working directory access mode
- Support option `-q` (quiet)'

#### v2.2.1 (January 2020)

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Version 2.2.1, January 2020

<pre><code><b>walk</b> [<b>-cyA</b>] [<b>--</b>] <i>ARCHIVE</i></code></pre>
<pre><code><b>walk</b> [<b>-cyAq</b>] [<b>--</b>] <i>ARCHIVE</i></code></pre>

# Description

Expand Down Expand Up @@ -98,6 +98,10 @@ These extensions are recognized:
can cause the current directory's owner and/or mode to be changed
by the archiver program,
so use this option with caution.
* **-q**
Quiet mode;
suppresses most archiver output
such as filenames that are being extracted/compressed.

# Notes

Expand Down
7 changes: 6 additions & 1 deletion doc/walk.1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
walk \- enter and manipulate archive files like directories
.SH SYNOPSIS
\fBwalk\fR
[\fB-cyA\fR]
[\fB-cyAq\fR]
[\fB--\fR]
\fIARCHIVE\fR
.SH DESCRIPTION
Expand Down Expand Up @@ -87,6 +87,11 @@ Unpacking archives which contain the \fB.\fR directory entry
can cause the current directory's owner and/or mode to be changed
by the archiver program,
so use this option with caution.
.TP
.B \-q
Quiet mode;
suppresses most archiver output
such as filenames that are being extracted/compressed.
.SH NOTES
Beware that some archive types have their own idiosyncracies
concerning file ownership:
Expand Down
5 changes: 3 additions & 2 deletions src/walk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ expect () {
esac
}

syntaxline="syntax: $prog [-cyA] ARCHIVE "
syntaxline="syntax: $prog [-cyAq] ARCHIVE "
help () {
printf '%s\n' "$syntaxline"
echo ""
Expand Down Expand Up @@ -136,10 +136,11 @@ read_arguments () {
[ "$arg" = "--" ] && break
done

while getopts 'cyAh' opt; do case "$opt" in
while getopts 'cyAqh' opt; do case "$opt" in
c) create_empty=yes ;;
y) force_answer=yes ;;
A) pack_root=yes ;;
q) quiet=yes ;;
h) help ;;
--) ;;
*) exit $EXIT_SYNTAX ;;
Expand Down

0 comments on commit a32a337

Please sign in to comment.