Skip to contentSkip to conversation

Bash completion script for util commands

PATCH In review Yves Blusseau 2 participants 2 messages Sep 1, 2010 – Sep 2, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bash completion script for util commands

* Makefile.am: Add util/bash-completion.d directory
* configure.ac: Likewise.
* util/bash-completion.d/Makefile.am: New file.
* util/bash-completion.d/grub-completion.bash.in: Likewise.

---
 ChangeLog.completion.bash                      |    6 
 Makefile.am                                    |    2 
 configure.ac                                   |    1 
 util/bash-completion.d/Makefile.am             |   15 +
 util/bash-completion.d/grub-completion.bash.in |  450 ++++++++++++++++++++++++
 5 files changed, 473 insertions(+), 1 deletions(-)
 create mode 100644 ChangeLog.completion.bash
 create mode 100644 util/bash-completion.d/Makefile.am
 create mode 100644 util/bash-completion.d/grub-completion.bash.in
ChangeLog.completion.bash new file +6 -0
new file mode 100644
index 0000000..e57374a
@@ -0,0 +1,6 @@
+Bash completion script for util commands
+
+    * Makefile.am:  Add util/bash-completion.d directory
+    * configure.ac: Likewise.
+    * util/bash-completion.d/Makefile.am: New file.
+    * util/bash-completion.d/grub-completion.bash.in: Likewise.
Makefile.am +1 -1
index 1cf2297..c05d352 100644
@@ -1,7 +1,7 @@
 AUTOMAKE_OPTIONS = subdir-objects
 
 DEPDIR = .deps-util
-SUBDIRS = . grub-core po docs
+SUBDIRS = . grub-core po docs util/bash-completion.d
 
 include $(top_srcdir)/conf/Makefile.common
 include $(top_srcdir)/conf/Makefile.extra-dist
configure.ac +1 -0
index b167408..fa96af7 100644
@@ -933,6 +933,7 @@ AC_CONFIG_FILES([Makefile])
 AC_CONFIG_FILES([grub-core/Makefile])
 AC_CONFIG_FILES([po/Makefile])
 AC_CONFIG_FILES([docs/Makefile])
+AC_CONFIG_FILES([util/bash-completion.d/Makefile])
 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
 
 AC_OUTPUT
util/bash-completion.d/Makefile.am new file +15 -0
new file mode 100644
index 0000000..774e1a3
@@ -0,0 +1,15 @@
+
+bash_completion_source = grub-completion.bash.in
+bash_completion_script = $(grubname)
+
+EXTRA_DIST = $(bash_completion_source)
+
+CLEANFILES = $(bash_completion_script)
+
+DISTCLEANFILES = *~
+
+bashcompletiondir = $(sysconfdir)/bash_completion.d
+bashcompletion_DATA = $(bash_completion_script)
+
+$(bash_completion_script): $(bash_completion_source) $(top_builddir)/config.status
+	$(top_builddir)/config.status --file=$@:$<
util/bash-completion.d/grub-completion.bash.in new file +450 -0

450 lines not on this page · raw message

#1 lore raw
Quoted 15 lines · Yves Blusseau

* Makefile.am: Add util/bash-completion.d directory
* configure.ac: Likewise.
* util/bash-completion.d/Makefile.am: New file.
* util/bash-completion.d/grub-completion.bash.in: Likewise.

---
 ChangeLog.completion.bash                      |    6 
 Makefile.am                                    |    2 
 configure.ac                                   |    1 
 util/bash-completion.d/Makefile.am             |   15 +
 util/bash-completion.d/grub-completion.bash.in |  450 ++++++++++++++++++++++++
 5 files changed, 473 insertions(+), 1 deletions(-)
 create mode 100644 ChangeLog.completion.bash
 create mode 100644 util/bash-completion.d/Makefile.am
 create mode 100644 util/bash-completion.d/grub-completion.bash.in
Quoted 5 lines

bash-completion.patch

+DISTCLEANFILES = *~

We don't add *~ in other Makefile.am. If this should be changed it should be on the level of whole GRUB

Quoted 2 lines

+__@grubname@_dir() {

Functionnames aren't transformed

Quoted 2 lines

+ root_dir=${root_dir-/}

but dirnames are

util/bash-completion.d/grub-completion.bash.in line 36

Quoted 3 lines
util/bash-completion.d/grub-completion.bash.in new file +2 -0
+    if [[ -d "$root_dir/boot" ]]; then
+        boot_dir="$root_dir/boot"

likewise

util/bash-completion.d/grub-completion.bash.in line 40

Quoted 6 lines
util/bash-completion.d/grub-completion.bash.in new file +4 -0
+    else
+        boot_dir="$root_dir"
 
+    fi
+    echo "${boot_dir%/}/grub"

likewise
These errors repeat themselves many times and make the patch more difficult to read. Once they are fixed I'll have another look for more comments.

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko