diff options
author | Clement Chauplannaz <chauplac@gmail.com> | 2013-05-12 15:08:51 -0400 |
---|---|---|
committer | Yann E. MORIN <yann.morin.1998@free.fr> | 2013-06-18 17:58:59 -0400 |
commit | 7387778510b7deaff866277877c5550c3a14f1fb (patch) | |
tree | 6ade8b4df392f68c0099583b73ce6007fc1c5b56 | |
parent | 1278ebdbc3167883f32095491990fbdc7cdf8b5e (diff) |
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>
-rwxr-xr-x | scripts/config | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/config b/scripts/config index bb4d3deb6d1c..6b3272ef6ec7 100755 --- a/scripts/config +++ b/scripts/config | |||
@@ -1,6 +1,8 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | # Manipulate options in a .config file from the command line | 2 | # Manipulate options in a .config file from the command line |
3 | 3 | ||
4 | myname=${0##*/} | ||
5 | |||
4 | # If no prefix forced, use the default CONFIG_ | 6 | # If no prefix forced, use the default CONFIG_ |
5 | CONFIG_="${CONFIG_-CONFIG_}" | 7 | CONFIG_="${CONFIG_-CONFIG_}" |
6 | 8 | ||
@@ -8,7 +10,7 @@ usage() { | |||
8 | cat >&2 <<EOL | 10 | cat >&2 <<EOL |
9 | Manipulate options in a .config file from the command line. | 11 | Manipulate options in a .config file from the command line. |
10 | Usage: | 12 | Usage: |
11 | config options command ... | 13 | $myname options command ... |
12 | commands: | 14 | commands: |
13 | --enable|-e option Enable option | 15 | --enable|-e option Enable option |
14 | --disable|-d option Disable option | 16 | --disable|-d option Disable option |
@@ -33,14 +35,14 @@ options: | |||
33 | --file config-file .config file to change (default .config) | 35 | --file config-file .config file to change (default .config) |
34 | --keep-case|-k Keep next symbols' case (dont' upper-case it) | 36 | --keep-case|-k Keep next symbols' case (dont' upper-case it) |
35 | 37 | ||
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 |
37 | make time. | 39 | make time. |
38 | 40 | ||
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 |
40 | the case of all following symbols unchanged. | 42 | the case of all following symbols unchanged. |
41 | 43 | ||
42 | config uses 'CONFIG_' as the default symbol prefix. Set the environment | 44 | $myname uses 'CONFIG_' as the default symbol prefix. Set the environment |
43 | variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" config ... | 45 | variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" $myname ... |
44 | EOL | 46 | EOL |
45 | exit 1 | 47 | exit 1 |
46 | } | 48 | } |