From: Michael Prokop Date: Sat, 2 Dec 2006 17:47:54 +0000 (+0100) Subject: * fma has been renamed into qma. Supports "directly jump to X-Git-Tag: 0.9.4~2 X-Git-Url: http://git.grml.org/?p=grml-scripts.git;a=commitdiff_plain;h=c4b59a2c68a05667806d9c65d5654683fbf1b3da * fma has been renamed into qma. Supports "directly jump to keyword" now. (Closes: issue19) --- diff --git a/debian/changelog b/debian/changelog index d1029c3..f34dcc9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-scripts (0.9.2) unstable; urgency=low + + * fma has been renamed into qma. Supports "directly jump to + keyword" now. (Closes: issue19) + + -- Michael Prokop Sat, 2 Dec 2006 18:46:31 +0100 + grml-scripts (0.9.1) unstable; urgency=low * New version number for new release. diff --git a/debian/rules b/debian/rules index 47efcc4..945126d 100755 --- a/debian/rules +++ b/debian/rules @@ -54,7 +54,7 @@ binary-arch: build install dh_installchangelogs dh_installdocs dh_installman manpages/grml-scripts.1 manpages/grml-bind.8 manpages/reread_partition_table.8 manpages/gtf.1 manpages/random-hostname.1 \ - manpages/grml-setkeyboard.8 manpages/grml-setlang.8 manpages/getsf.1 manpages/grml-iptstate.8 manpages/fma.1 manpages/grml-swapon.8 + manpages/grml-setkeyboard.8 manpages/grml-setlang.8 manpages/getsf.1 manpages/grml-iptstate.8 manpages/qma.1 manpages/grml-swapon.8 # cp --no-dereference man/*.1.gz debian/grml-scripts/usr/share/man/man1/ dh_link /usr/sbin/blacklist /usr/sbin/unblacklist dh_link /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/align.1.gz diff --git a/manpages/fma.1 b/manpages/qma.1 similarity index 65% rename from manpages/fma.1 rename to manpages/qma.1 index 6fc93c4..48fe117 100644 --- a/manpages/fma.1 +++ b/manpages/qma.1 @@ -1,18 +1,18 @@ .TH FMA 1 .SH NAME -fma \- fast manual access +qma \- quick manual access .SH SYNOPSIS -.B fma -.RI [ section ] " manualpage" +.B qma +.RI "[ section ] manualpage [ keyword ]" .SH DESCRIPTION This manual page documents briefly the -.B fma +.B qma command. .PP -\fBfma\fP is a script which allows fast and efficient access to manual pages +\fBqma\fP is a script which allows quick and efficient access to manual pages through using compression via lzop and display of vim. -fma generates manpages via running 'man ' and storing +qma generates manpages via running 'man ' and storing the result in a file with the extension txt in directory $HOME/man. Then lzop is executed for the file and the output is written to a file with the additional extension lzo. Afterwards the editor vim is executed with @@ -21,9 +21,13 @@ filetype set to man and using on-the-fly decompressing using lzop again. So far you did not win any time of course. But if you want to display the same manpage again the processed manpage already exists in $HOME/man and can be displayed immediately. If you want to experience the difference -just run 'fma zshall' two times and compare it with 'man zshall' too. +just run 'qma zshall' two times and compare it with 'man zshall' too. + +If you want to jump to a special keyword inside the manpage use it as +last option of the qma commandline. Searching for the keyword is done +case insensitive inside vim. .SH OPTIONS -fma supports the following options: +qma supports the following options: .TP .B \-h, \-\-help Show summary of options. @@ -36,16 +40,19 @@ If the environment variable MANDIR is set the specified directory is taken for output files instead of the default directory $HOME/man. .SH USAGE EXAMPLE .TP -.B % fma zshall +.B % qma zshall Display manpage zshall (man zshall). .TP -.B % fma 1 read +.B % qma 1 read Display manpage read of section 1 (man 1 read). .TP -.B % fma 2 read +.B % qma 2 read Display manpage read of section 2 (man 2 read). +.TP +.B % qma grml overview +Display manpage grml and jump to keyword "overview". .SH AUTHOR -fma was written by Michael Prokop based on an idea of +qma was written by Michael Prokop based on an idea of Matthias Kopfermann . .PP This manual page was written by Michael Prokop diff --git a/usr_bin/fma b/usr_bin/qma similarity index 73% rename from usr_bin/fma rename to usr_bin/qma index 5b7950a..c7944dc 100755 --- a/usr_bin/fma +++ b/usr_bin/qma @@ -1,10 +1,10 @@ #!/bin/zsh -# Filename: fma -# Purpose: "fast manual access" +# Filename: qma +# Purpose: "quick manual access" # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Son Nov 12 12:03:13 CET 2006 [mika] +# Latest change: Sam Dez 02 18:40:18 CET 2006 [mika] ################################################################################ # Idea for this script and basic functionally by Matthias Kopfermann . @@ -23,7 +23,7 @@ if ! [ -d "$MANDIR" ] ; then fi usage() { - eerror "Usage: fma [section] manpage" ; eend 1 + eerror "Usage: qma [section] manpage" ; eend 1 exit 1 } @@ -32,7 +32,7 @@ case $1 in usage ;; -v*|--v*) - einfo "fma - version $VERSION" ; eend 0 + einfo "qma - version $VERSION" ; eend 0 exit 0 ;; [0-9]) @@ -62,8 +62,12 @@ if ! [ -f "${MANDIR}/${MANPAGE}${SECTIONFILE}.txt.lzo" ] ; then fi fi -vim -c 'set ft=man' =( lzop -cd $MANDIR/${MANPAGE}${SECTIONFILE}.txt.lzo) +if [ -n "$SEARCH" ] ; then + vim -c "set ft=man | set hlsearch | set ignorecase" +/"$SEARCH" =( lzop -cd $MANDIR/${MANPAGE}${SECTIONFILE}.txt.lzo) +else + vim -c 'set ft=man' =( lzop -cd $MANDIR/${MANPAGE}${SECTIONFILE}.txt.lzo) +fi -einfo "Thanks for flying fma using vim and lzop." ; eend 0 +einfo "Thanks for flying qma using vim and lzop." ; eend 0 ## END OF FILE #################################################################