* [PATCH 2/2] Add --debug to set -x for a few grub commands
@ 2016-05-28 11:53 Andrew Worsley
2016-05-29 6:34 ` Vladimir 'phcoder' Serbinenko
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Worsley @ 2016-05-28 11:53 UTC (permalink / raw)
---
util/grub-kbdcomp.in | 2 ++
util/grub-mkconfig.in | 2 ++
util/grub-reboot.in | 2 ++
util/grub-set-default.in | 2 ++
4 files changed, 8 insertions(+)
diff --git a/util/grub-kbdcomp.in b/util/grub-kbdcomp.in
index a15ec24..74a3ffd 100644
--- a/util/grub-kbdcomp.in
+++ b/util/grub-kbdcomp.in
@@ -27,6 +27,7 @@ usage () {
print_option_help "-h, --help" "$(gettext "print this message and exit")"
print_option_help "-V, --version" "$(gettext "print the version information and exit")"
print_option_help "-o, --output=$(gettext FILE)" "$(gettext "save output in FILE [required]")"
+ print_option_help "-d, --debug" "$(gettext "print shell commands as they are run")"
echo
gettext_printf "%s generates a keyboard layout for GRUB using ckbcomp\n" "$self"
echo
@@ -61,6 +62,7 @@ do
output=`argument $option "$@"`; shift ;;
--output=*)
output=`echo "$option" | sed 's/--output=//'` ;;
+ -d | --debug) set -x ;;
*)
ckbcomp_options="$ckbcomp_options $option";;
esac
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index f8496d2..2ce73a5 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -60,6 +60,7 @@ usage () {
print_option_help "-o, --output=$(gettext FILE)" "$(gettext "output generated config to FILE [default=stdout]")"
print_option_help "-h, --help" "$(gettext "print this message and exit")"
print_option_help "-v, --version" "$(gettext "print the version information and exit")"
+ print_option_help "-d, --debug" "$(gettext "print shell commands as they are run")"
echo
gettext "Report bugs to <bug-grub@gnu.org>."; echo
}
@@ -88,6 +89,7 @@ do
-V | --version)
echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
exit 0 ;;
+ -d | --debug) set -x ;;
-o | --output)
grub_cfg=`argument $option "$@"`; shift;;
--output=*)
diff --git a/util/grub-reboot.in b/util/grub-reboot.in
index 4d4f757..c8fa19c 100644
--- a/util/grub-reboot.in
+++ b/util/grub-reboot.in
@@ -48,6 +48,7 @@ usage () {
gettext "Set the default boot menu entry for GRUB, for the next boot only."; echo
print_option_help "-h, --help" "$(gettext "print this message and exit")"
print_option_help "-V, --version" "$(gettext "print the version information and exit")"
+ print_option_help "-d, --debug" "$(gettext "print shell commands as they are run")"
dirmsg="$(gettext_printf "expect GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")"
print_option_help "--boot-directory=$(gettext "DIR")" "$dirmsg"
echo
@@ -84,6 +85,7 @@ do
-V | --version)
echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
exit 0 ;;
+ -d | --debug) set -x ;;
# Accept for compatibility
--root-directory)
diff --git a/util/grub-set-default.in b/util/grub-set-default.in
index 6036f81..ebc3ae9 100644
--- a/util/grub-set-default.in
+++ b/util/grub-set-default.in
@@ -50,6 +50,7 @@ usage () {
echo
print_option_help "-h, --help" "$(gettext "print this message and exit")"
print_option_help "-V, --version" "$(gettext "print the version information and exit")"
+ print_option_help "-d, --debug" "$(gettext "print shell commands as they are run")"
dirmsg="$(gettext_printf "expect GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")"
print_option_help "--boot-directory=$(gettext "DIR")" "$dirmsg"
echo
@@ -82,6 +83,7 @@ do
-V | --version)
echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
exit 0 ;;
+ -d | --debug) set -x ;;
# Accept for compatibility
--root-directory)
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] Add --debug to set -x for a few grub commands
2016-05-28 11:53 [PATCH 2/2] Add --debug to set -x for a few grub commands Andrew Worsley
@ 2016-05-29 6:34 ` Vladimir 'phcoder' Serbinenko
2016-05-29 10:13 ` Andrew Worsley
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2016-05-29 6:34 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 4354 bytes --]
What is advantage compared with running scripts with bash -x script name ?
Le dim. 29 mai 2016 07:54, Andrew Worsley <amworsley@gmail.com> a écrit :
> ---
> util/grub-kbdcomp.in | 2 ++
> util/grub-mkconfig.in | 2 ++
> util/grub-reboot.in | 2 ++
> util/grub-set-default.in | 2 ++
> 4 files changed, 8 insertions(+)
>
> diff --git a/util/grub-kbdcomp.in b/util/grub-kbdcomp.in
> index a15ec24..74a3ffd 100644
> --- a/util/grub-kbdcomp.in
> +++ b/util/grub-kbdcomp.in
> @@ -27,6 +27,7 @@ usage () {
> print_option_help "-h, --help" "$(gettext "print this message and
> exit")"
> print_option_help "-V, --version" "$(gettext "print the version
> information and exit")"
> print_option_help "-o, --output=$(gettext FILE)" "$(gettext "save
> output in FILE [required]")"
> + print_option_help "-d, --debug" "$(gettext "print shell commands as
> they are run")"
> echo
> gettext_printf "%s generates a keyboard layout for GRUB using
> ckbcomp\n" "$self"
> echo
> @@ -61,6 +62,7 @@ do
> output=`argument $option "$@"`; shift ;;
> --output=*)
> output=`echo "$option" | sed 's/--output=//'` ;;
> + -d | --debug) set -x ;;
> *)
> ckbcomp_options="$ckbcomp_options $option";;
> esac
> diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
> index f8496d2..2ce73a5 100644
> --- a/util/grub-mkconfig.in
> +++ b/util/grub-mkconfig.in
> @@ -60,6 +60,7 @@ usage () {
> print_option_help "-o, --output=$(gettext FILE)" "$(gettext "output
> generated config to FILE [default=stdout]")"
> print_option_help "-h, --help" "$(gettext "print this message and
> exit")"
> print_option_help "-v, --version" "$(gettext "print the version
> information and exit")"
> + print_option_help "-d, --debug" "$(gettext "print shell commands as
> they are run")"
> echo
> gettext "Report bugs to <bug-grub@gnu.org>."; echo
> }
> @@ -88,6 +89,7 @@ do
> -V | --version)
> echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
> exit 0 ;;
> + -d | --debug) set -x ;;
> -o | --output)
> grub_cfg=`argument $option "$@"`; shift;;
> --output=*)
> diff --git a/util/grub-reboot.in b/util/grub-reboot.in
> index 4d4f757..c8fa19c 100644
> --- a/util/grub-reboot.in
> +++ b/util/grub-reboot.in
> @@ -48,6 +48,7 @@ usage () {
> gettext "Set the default boot menu entry for GRUB, for the next boot
> only."; echo
> print_option_help "-h, --help" "$(gettext "print this message and
> exit")"
> print_option_help "-V, --version" "$(gettext "print the version
> information and exit")"
> + print_option_help "-d, --debug" "$(gettext "print shell commands as
> they are run")"
> dirmsg="$(gettext_printf "expect GRUB images under the directory
> DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")"
> print_option_help "--boot-directory=$(gettext "DIR")" "$dirmsg"
> echo
> @@ -84,6 +85,7 @@ do
> -V | --version)
> echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
> exit 0 ;;
> + -d | --debug) set -x ;;
>
> # Accept for compatibility
> --root-directory)
> diff --git a/util/grub-set-default.in b/util/grub-set-default.in
> index 6036f81..ebc3ae9 100644
> --- a/util/grub-set-default.in
> +++ b/util/grub-set-default.in
> @@ -50,6 +50,7 @@ usage () {
> echo
> print_option_help "-h, --help" "$(gettext "print this message and
> exit")"
> print_option_help "-V, --version" "$(gettext "print the version
> information and exit")"
> + print_option_help "-d, --debug" "$(gettext "print shell commands as
> they are run")"
> dirmsg="$(gettext_printf "expect GRUB images under the directory
> DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")"
> print_option_help "--boot-directory=$(gettext "DIR")" "$dirmsg"
> echo
> @@ -82,6 +83,7 @@ do
> -V | --version)
> echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
> exit 0 ;;
> + -d | --debug) set -x ;;
>
> # Accept for compatibility
> --root-directory)
> --
> 2.1.4
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
[-- Attachment #2: Type: text/html, Size: 7197 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] Add --debug to set -x for a few grub commands
2016-05-29 6:34 ` Vladimir 'phcoder' Serbinenko
@ 2016-05-29 10:13 ` Andrew Worsley
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Worsley @ 2016-05-29 10:13 UTC (permalink / raw)
To: The development of GNU GRUB
On 29 May 2016 at 16:34, Vladimir 'phcoder' Serbinenko
<phcoder@gmail.com> wrote:
> What is advantage compared with running scripts with bash -x script name ?
>
For a naive user they may not even realise it is a shell script or
that the running it via bash -x option will give a valuable debug
output. I didn't until I did a bunch of work on it. It is an extremely
simple addition but very helpful to understand is going on and gives
useful debug reports.
I was thinking that we could expand this to have a level with lower
levels printing out settings of key variables and a high level
generating the -x output. But I think at least having this debug
output easily available is an easy but valuable improvement.
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-05-29 10:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-28 11:53 [PATCH 2/2] Add --debug to set -x for a few grub commands Andrew Worsley
2016-05-29 6:34 ` Vladimir 'phcoder' Serbinenko
2016-05-29 10:13 ` Andrew Worsley
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.