Commit Graph

11 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