mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-02 23:35:37 +00:00
Merge aa-remove-unknown: Drop superfluous $0 parameter from usage()
$0 is always the name of the script, even if using it inside a function. Therefore use $0 directly, and no longer hand it over as a parameter. Also `chmod +x aa-remove-unknown` to make in-tree testing easier. MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/785 Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
10
utils/aa-remove-unknown
Normal file → Executable file
10
utils/aa-remove-unknown
Normal file → Executable file
@@ -25,8 +25,8 @@ DRY_RUN=0
|
|||||||
. $APPARMOR_FUNCTIONS
|
. $APPARMOR_FUNCTIONS
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
local progname="$1"
|
local progname="$0"
|
||||||
local rc="$2"
|
local rc="$1"
|
||||||
local msg="usage: ${progname} [options]
|
local msg="usage: ${progname} [options]
|
||||||
|
|
||||||
Remove profiles unknown to the system
|
Remove profiles unknown to the system
|
||||||
@@ -45,14 +45,14 @@ Options:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if [ "$#" -gt 1 ] ; then
|
if [ "$#" -gt 1 ] ; then
|
||||||
usage "$0" 1
|
usage 1
|
||||||
elif [ "$#" -eq 1 ] ; then
|
elif [ "$#" -eq 1 ] ; then
|
||||||
if [ "$1" = "-h" -o "$1" = "--help" ] ; then
|
if [ "$1" = "-h" -o "$1" = "--help" ] ; then
|
||||||
usage "$0" 0
|
usage 0
|
||||||
elif [ "$1" = "-n" ] ; then
|
elif [ "$1" = "-n" ] ; then
|
||||||
DRY_RUN=1
|
DRY_RUN=1
|
||||||
else
|
else
|
||||||
usage "$0" 1
|
usage 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user