Commit f28ef96d authored by Quentin Monnet's avatar Quentin Monnet Committed by Alexei Starovoitov
Browse files

tools: bpftool: Include common options from separate file



Nearly all man pages for bpftool have the same common set of option
flags (--help, --version, --json, --pretty, --debug). The description is
duplicated across all the pages, which is more difficult to maintain if
the description of an option changes. It may also be confusing to sort
out what options are not "common" and should not be copied when creating
new manual pages.

Let's move the description for those common options to a separate file,
which is included with a RST directive when generating the man pages.

Signed-off-by: default avatarQuentin Monnet <quentin@isovalent.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarAndrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200909162500.17010-3-quentin@isovalent.com
parent 82b8cf0a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ man8dir = $(mandir)/man8
# Load targets for building eBPF helpers man page.
include ../../Makefile.helpers

MAN8_RST = $(filter-out $(HELPERS_RST),$(wildcard *.rst))
MAN8_RST = $(wildcard bpftool*.rst)

_DOC_MAN8 = $(patsubst %.rst,%.8,$(MAN8_RST))
DOC_MAN8 = $(addprefix $(OUTPUT),$(_DOC_MAN8))
+1 −16
Original line number Diff line number Diff line
@@ -71,22 +71,7 @@ DESCRIPTION

OPTIONS
=======
	-h, --help
		  Print short generic help message (similar to **bpftool help**).

	-V, --version
		  Print version number (similar to **bpftool version**).

	-j, --json
		  Generate JSON output. For commands that cannot produce JSON, this
		  option has no effect.

	-p, --pretty
		  Generate human-readable JSON output. Implies **-j**.

	-d, --debug
		  Print all logs available from libbpf, including debug-level
		  information.
	.. include:: common_options.rst

EXAMPLES
========
+1 −16
Original line number Diff line number Diff line
@@ -116,26 +116,11 @@ DESCRIPTION

OPTIONS
=======
	-h, --help
		  Print short generic help message (similar to **bpftool help**).

	-V, --version
		  Print version number (similar to **bpftool version**).

	-j, --json
		  Generate JSON output. For commands that cannot produce JSON, this
		  option has no effect.

	-p, --pretty
		  Generate human-readable JSON output. Implies **-j**.
	.. include:: common_options.rst

	-f, --bpffs
		  Show file names of pinned programs.

	-d, --debug
		  Print all logs available from libbpf, including debug-level
		  information.

EXAMPLES
========
|
+1 −16
Original line number Diff line number Diff line
@@ -71,22 +71,7 @@ DESCRIPTION

OPTIONS
=======
	-h, --help
		  Print short generic help message (similar to **bpftool help**).

	-V, --version
		  Print version number (similar to **bpftool version**).

	-j, --json
		  Generate JSON output. For commands that cannot produce JSON, this
		  option has no effect.

	-p, --pretty
		  Generate human-readable JSON output. Implies **-j**.

	-d, --debug
		  Print all logs available from libbpf, including debug-level
		  information.
	.. include:: common_options.rst

SEE ALSO
========
+1 −16
Original line number Diff line number Diff line
@@ -126,22 +126,7 @@ DESCRIPTION

OPTIONS
=======
	-h, --help
		  Print short generic help message (similar to **bpftool help**).

	-V, --version
		  Print version number (similar to **bpftool version**).

	-j, --json
		  Generate JSON output. For commands that cannot produce JSON,
		  this option has no effect.

	-p, --pretty
		  Generate human-readable JSON output. Implies **-j**.

	-d, --debug
		  Print all logs available from libbpf, including debug-level
		  information.
	.. include:: common_options.rst

EXAMPLES
========
Loading