Skip to content

Commit 7387778

Browse files
chauplacyann-morin-1998
authored andcommitted
scripts/config: replace hard-coded script name by a dynamic value
The script `config' prints its name in usage() function. It is currently hard-coded to value `config'. However, the script may be reused under a different name in contexts other than the Linux Kernel. Replace the hard-coded value `config' by the name of the script at runtime. Signed-off-by: Clement Chauplannaz <chauplac@gmail.com> Acked-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
1 parent 1278ebd commit 7387778

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

scripts/config

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#!/bin/bash
22
# Manipulate options in a .config file from the command line
33

4+
myname=${0##*/}
5+
46
# If no prefix forced, use the default CONFIG_
57
CONFIG_="${CONFIG_-CONFIG_}"
68

79
usage() {
810
cat >&2 <<EOL
911
Manipulate options in a .config file from the command line.
1012
Usage:
11-
config options command ...
13+
$myname options command ...
1214
commands:
1315
--enable|-e option Enable option
1416
--disable|-d option Disable option
@@ -33,14 +35,14 @@ options:
3335
--file config-file .config file to change (default .config)
3436
--keep-case|-k Keep next symbols' case (dont' upper-case it)
3537
36-
config doesn't check the validity of the .config file. This is done at next
38+
$myname doesn't check the validity of the .config file. This is done at next
3739
make time.
3840
39-
By default, config will upper-case the given symbol. Use --keep-case to keep
41+
By default, $myname will upper-case the given symbol. Use --keep-case to keep
4042
the case of all following symbols unchanged.
4143
42-
config uses 'CONFIG_' as the default symbol prefix. Set the environment
43-
variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" config ...
44+
$myname uses 'CONFIG_' as the default symbol prefix. Set the environment
45+
variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" $myname ...
4446
EOL
4547
exit 1
4648
}

0 commit comments

Comments
 (0)