Commit Graph

50 Commits

Author SHA1 Message Date
Jakub Wilk 1d32ab01fc scripts/bash_aliases: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-08-08 01:02:32 +02:00
Alejandro Colomar 1ad9eda841 scripts/bash_aliases: man_lsfunc(): Extract syscall name from syscall(SYS_...)
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-11 17:18:08 +12:00
Alejandro Colomar 34afcb0dad scripts/bash_aliases: srcfix
I clarified the code about two things:

- Checking how many arguments are being passed.
    Here, some functions didn't reject extra arguments when they
    weren't being used.  Fix that.
    I also changed the code to use $#, which is more explicit.
    And use arithmetic expressions, which better indicate that
    we're dealing with numbers.

- Remove unneeded options from sort.
    Reported-by: Stefan Puiu <stefan.puiu@gmail.com>
    After Stefan asked about why am I using 'sort -V',
    I noticed that I really don't need '-V', and it may confuse
    people trying to understand the script, so even though I
    slightly prefer the output of 'sort -V', in this case, it's
    better to use the simpler 'sort' (yet I need 'sort', to
    maintain consistency in the results (find is quite random)).

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 11:33:51 +12:00
Alejandro Colomar 94bf02f41b scripts/bash_aliases: Fix error messages
Fix the error messages to clearly show that both dirs and manual
pages are accepted, and that more than one argument is accepted.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 11:33:27 +12:00
Alejandro Colomar a3ccd456f3 scripts/bash_aliases: man_section(): Accept multiple sections
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 11:33:10 +12:00
Alejandro Colomar 3a42b0815e scripts/bash_aliases: Add man_lsvar(), similar to man_lsfunc() but lists variables
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 11:32:42 +12:00
Alejandro Colomar 5ae99ccb42 scripts/bash_aliases: Make man_lsfunc() more robust; Add sed_rm_ccomments().
This patch makes man_lsfunc() search for the function prototypes,
instead of relying on the current manual page formatting,
which might change in the future, and break this function.

It also simplifies the code, by reusing man_section().

Create a new function sed_rm_ccomments(), which is needed by
man_lsfunc(), and may also be useful in other cases.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 11:32:17 +12:00
Alejandro Colomar b08daf3c0c scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command
The output of 'git status' is not stable.

The more stable 'git status --porcelain' is more complex,
and scripting around it would be more complex.

However, 'git diff --staged --name-only' produces
the output that we were lookiong for.

Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 11:27:19 +12:00
Alejandro Colomar f493a71fe1 scripts/bash_aliases, scripts/modified_pages.sh: Move scripts/modified_pages.sh to a function man_gitstaged()
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-10 11:27:12 +12:00
Jakub Wilk b88c066d29 scripts/bash_aliases: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-03-03 23:06:32 +01:00
Alejandro Colomar 64b8654d8b scripts/bash_aliases: Add useful functions
That file should be sourced (.) from 'bashrc' (or 'bash_aliases').

It contains functions that are useful for the maintenance of this
project.

- grep_syscall()
- grep_syscall_def()
- man_section()
- man_lsfunc()
- pdfman()
- grep_glibc_prototype()

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-02-20 22:45:20 +01:00
Alejandro Colomar 1d8566691a Add script to get modified pages for commit messages
The script can be used this way:

git commit -sm "$(./scripts/modified_pages.sh): Short commit msg"

And then maybe --amend and add a longer message.

This is especially useful for changes to many pages at once,
usually when running a script to apply some global changes.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 21:26:15 +01:00
Michael Kerrisk 5a659c0829 check_unbalanced_macros.sh: A script to look for unbalanced *roff/man macro pairs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-16 11:26:23 +01:00
Michael Kerrisk 10414db19b man_show_fixme.sh: Don't hyphenate or justify the manual page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-28 09:42:41 +01:00
Michael Kerrisk 30d41ce662 FIXME_list.sh: Fix broken regexp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 19:42:47 +01:00
Michael Kerrisk d8f63a9860 man_show_fixme.sh: Fix misquoted double quotes in regexps
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-30 09:39:05 +02:00
Mike Frysinger b4c38a723f drop "coding: UTF-8" header
This header is used inconsistently -- man pages are UTF-8 encoded
but not setting this marker.  It's only respected by the man-db
package, and seems a bit anachronistic at this point when UTF-8
is the standard default nowadays.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-13 09:36:46 +02:00
Mike Frysinger 26cea65499 scripts: mark them executable
It's easier to run `./scripts/foo.sh ...` than
`bash ./scripts/foo.sh ...`.  Mark them all +x to support that.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 21:34:32 +02:00
Michael Kerrisk baecfd79dc man_show_fixme.sh: Fix rendering issue
If a single quote falls at the start of a line, then the rest of
the line is treated as a comment. Therefore, escape single quotes.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-27 09:36:23 +01:00
Michael Kerrisk d3fc509df8 man_show_fixme.sh: strip extraneous blank line at start of rendered FIXME output
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-10-31 16:44:57 +01:00
Michael Kerrisk 96561bfd57 man_show_fixme.sh: Minor tweaks
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-10-31 14:38:59 +01:00
Michael Kerrisk 4c4e6e3ff3 man_show_fixme.sh: Tweak indent lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-10-31 02:41:30 +01:00
Michael Kerrisk 110cdfd27a man_show_fixme.sh: f
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-10-31 02:41:29 +01:00
Michael Kerrisk b128ebfdf4 man_show_fixme.sh: Make output tables a little narrower
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-10-29 18:24:38 +02:00
Michael Kerrisk 0524b5b9ac man_show_fixme.sh: script to show FIXMEs in rendered man pages
A script that renders man pages with FIXMES as table
in rendered text.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-10-29 13:49:24 +02:00
Jakub Wilk fae23c624e scripts/markup_check.sh: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-12-07 08:13:20 +01:00
Stéphane Aulery 1870c751c1 find_repeated_words.sh: Do not process files that are redirects
Signed-off-by: Stéphane Aulery <saulery@free.fr>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2015-03-22 19:25:22 +01:00
Michael Kerrisk d62018316a Update usage message 2014-08-21 16:47:28 -05:00
Michael Kerrisk 5c97c6df63 convert_to_utf_8.sh: Fix buggy treatment of iso_8859-{11,13}.7
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-02-18 09:27:48 +01:00
Peter Schiffer 7a9cda971e print_encoding.sh: Script to list pages that employ character sets other than us-ascii
See https://bugzilla.kernel.org/show_bug.cgi?id=60807

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-02-16 08:32:08 +01:00
Peter Schiffer 2bde1fa364 convert_to_utf_8.sh: Script to convert pages to UTF-8
See https://bugzilla.kernel.org/show_bug.cgi?id=60807

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-02-16 08:32:07 +01:00
Michael Kerrisk cf98af1408 markup_check.sh: Script to check for common man-page markup errors
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-02-10 11:38:24 +01:00
Michael Kerrisk 404b6a03ac FIXME_list.sh, add_parens_for_own_funcs.sh, find_dots_no_parens.sh, find_repeated_words.sh, find_slashes_no_parens.sh, remove_COLOPHON.sh, unformat_parens.sh: Add copyright and license
Reported-by: Felix Janda <felix.janda@posteo.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-09-16 05:03:49 +02:00
Michael Kerrisk 87b8bb4eef FIXME_list.sh: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-09-16 04:42:20 +02:00
Michael Kerrisk d60ee8836f find_repeated_words.sh: Add filename in comments
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-09-16 04:41:47 +02:00
Michael Kerrisk 606043ca67 find_repeated_words.sh: Fix bug
setting of MANWIDTH needs to be in environmnt of "man -l"

Signed-off-by: Michael Kerrisk <mtk@konstanz.(none)>
2010-08-29 14:41:52 +02:00
Michael Kerrisk bdb507e4ca Script to remove the COLOPHON section from the man pages provided as
command-line arguments.  This is useful to remove the COLOPHON sections
from all of the man pages in two different release trees in order to do a
"diff -ruN" to see the "real" differences between the trees.
2008-01-13 08:32:15 +00:00
Michael Kerrisk 028bd83c9a error fix 2007-09-19 21:23:50 +00:00
Michael Kerrisk c092684fe3 Minor changes 2007-09-10 04:14:12 +00:00
Michael Kerrisk f99f8b423a handle "FIXME ?" 2007-06-14 05:57:12 +00:00
Michael Kerrisk 3511dcdbf5 minor fixes 2007-06-09 12:41:40 +00:00
Michael Kerrisk 2b50ade454 Small comment fix. 2007-03-02 07:16:05 +00:00
Michael Kerrisk f1b981147e Find duplicate consecutive words in files 2007-03-01 16:24:55 +00:00
Michael Kerrisk 4fef468eb1 Allow multiple directory command-line arguments 2006-07-18 16:00:24 +00:00
Michael Kerrisk df8f1fd63d Better name. 2006-07-11 04:48:24 +00:00
Michael Kerrisk 565495b1de Name change 2006-07-11 04:48:07 +00:00
Michael Kerrisk d7ad251c0c A script that displays FIXMEs in the man page source files 2006-07-11 04:45:50 +00:00
Michael Kerrisk 3399ba3ae5 minor fixes 2005-10-19 12:42:20 +00:00
Michael Kerrisk 6f9c0c6b3b Maintenance scripts 2005-10-19 12:04:53 +00:00
Michael Kerrisk f8fc5a2301 Maintenance scripts 2005-10-19 07:28:43 +00:00