8000 Read description prose, usage verbs and the fullest help a tool lists by sadigaxund · Pull Request #230 · AS-FOSS/mandible · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

### Fixed

- [S-277] A sentence that heads an option table (`Mandatory arguments to long options are mandatory for short options too.` on `cp`, `uniq`, `du`, `od` and others) ends the description instead of being dropped.
- [S-278] `ffmpeg` is read from `ffmpeg -h full`, the most complete help it lists, instead of the basic `ffmpeg -h`.
- [S-279] `python3` no longer repeats its option table as description text.
- [S-280] `kernel-install` lists `add`, `add-all`, `remove`, `inspect` and `list` as commands, each with the operands of its own usage form, and shows its `COMMAND` line as the first usage form.
- [S-281] `elfedit` and `readelf` show the sentence under their usage line as description and no longer invent an `ELF` operand; `pngfix` shows its description.
- [S-269] `ip` lists `-iec`, `-j[son]`, `-p[retty]` and `-br[ief]` as their own flags instead of text on `-h` and `-l[oops]`, and `-l[oops]` takes the value `maximum-addr-flush-attempts`.
- [S-270] `git stash` no longer lists `diff-options` and `commit`: `git stash show` lists `diff-options` and `git stash store` lists `commit`, and `stash drop`, `pop`, `apply`, `git bundle verify` and `git remote prune` list the operand their usage form names.
- [S-237] `mandible jfr configure` keeps the line breaks and indentation of the `option=value`, `event-setting=value` and `Options for default.jfc:` rows in its description.
Expand Down
2 changes: 2 additions & 0 deletions corpus/bzless/audit-seed2/expected.screen
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
DESCRIPTION ────────────────────────────────────────────────────────────────
bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019.

If invoked as `bzip2', default action is to compress.


USAGE ──────────────────────────────────────────────────────────────────────
bzip2 [flags and input files in any order]
Expand Down
5 changes: 4 additions & 1 deletion corpus/bzless/audit-seed2/expected.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: bzless
description: bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019.
description: |-
bzip2, a block-sorting file compressor. Version 1.0.8, 13-Jul-2019.

If invoked as `bzip2', default action is to compress.
usage:
- 'usage: bzip2 [flags and input files in any order]'
flags:
Expand Down
2 changes: 2 additions & 0 deletions corpus/cp/9.4/expected.screen
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
DESCRIPTION ────────────────────────────────────────────────────────────────
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.

Mandatory arguments to long options are mandatory for short options too.


USAGE ──────────────────────────────────────────────────────────────────────
cp [OPTION]... [-T] SOURCE DEST
Expand Down
5 changes: 4 additions & 1 deletion corpus/cp/9.4/expected.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: cp
description: Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
description: |-
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.

Mandatory arguments to long options are mandatory for short options too.
usage:
- 'Usage: /usr/bin/cp [OPTION]... [-T] SOURCE DEST'
- ' or: /usr/bin/cp [OPTION]... SOURCE... DIRECTORY'
Expand Down
1 change: 1 addition & 0 deletions corpus/cp/9.4/meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ argv = ["cp", "--help"]
stdout = "help.txt"

[contract]
must_describe_root = ["Mandatory arguments to long options are mandatory for short options too."]
must_draw = ["-S, --suffix=SUFFIX"]

[contract.must_attach_choices]
Expand Down
2 changes: 2 additions & 0 deletions corpus/du/9.4/expected.screen
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
DESCRIPTION ────────────────────────────────────────────────────────────────
Summarize device usage of the set of FILEs, recursively for directories.

Mandatory arguments to long options are mandatory for short options too.


USAGE ──────────────────────────────────────────────────────────────────────
du [OPTION]... [FILE]...
Expand Down
5 changes: 4 additions & 1 deletion corpus/du/9.4/expected.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: du
description: Summarize device usage of the set of FILEs, recursively for directories.
description: |-
Summarize device usage of the set of FILEs, recursively for directories.

Mandatory arguments to long options are mandatory for short options too.
usage:
- 'Usage: du [OPTION]... [FILE]...'
- ' or: du [OPTION]... --files0-from=F'
Expand Down
51 changes: 51 additions & 0 deletions corpus/elfedit/2.42/expected.screen
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
=== elfedit ===
DESCRIPTION ────────────────────────────────────────────────────────────────
Update the ELF header of ELF files

Report bugs to <https://sourceware.org/bugzilla/>


USAGE ──────────────────────────────────────────────────────────────────────
elfedit <option(s)> elffile(s)


POSITIONALS (1) ────────────────────────────────────────────────────────────
elffile(s)


FLAGS (12) ─────────────────────────────────────────────────────────────────
The options are
--input-mach [{…}]
Set input machine type
values: none, i386, iamcu, l1om, k1om, x86_64
--output-mach [{…}]
Set output machine type
values: none, i386, iamcu, l1om, k1om, x86_64
--input-type [{…}]
Set input file type
values: none, rel, exec, dyn
--output-type [{…}]
Set output file type
values: none, rel, exec, dyn
--input-osabi
[none|HPUX|NetBSD|GNU|Linux|Solaris|AIX|Irix|FreeBSD|TRU64|Modesto|OpenBSD
|OpenVMS|NSK|AROS|FenixOS]
Set input OSABI
--output-osabi
[none|HPUX|NetBSD|GNU|Linux|Solaris|AIX|Irix|FreeBSD|TRU64|Modesto|OpenBSD
|OpenVMS|NSK|AROS|FenixOS]
Set output OSABI
--input-abiversion [0-255]
Set input ABIVERSION
--output-abiversion [0-255]
Set output ABIVERSION
--enable-x86-feature [{…}]
Enable x86 feature
values: ibt, shstk, lam_u48, lam_u57
--disable-x86-feature [{…}]
Disable x86 feature
values: ibt, shstk, lam_u48, lam_u57
-h, --help
Display this information
-v, --version
Display the version number of elfedit
163 changes: 163 additions & 0 deletions corpus/elfedit/2.42/expected.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
name: elfedit
description: |-
Update the ELF header of ELF files

Report bugs to <https://sourceware.org/bugzilla/>
usage:
- 'Usage: elfedit <option(s)> elffile(s)'
positionals:
- name: elffile(s)
required: true
provenance:
sources:
- help-text
flags:
- spellings:
- --input-mach
value_kind: Optional
optional_join: separate
choices:
- none
- i386
- iamcu
- l1om
- k1om
- x86_64
group: 'The options are:'
description: Set input machine type
provenance:
sources:
- help-text
- spellings:
- --output-mach
value_kind: Optional
optional_join: separate
choices:
- none
- i386
- iamcu
- l1om
- k1om
- x86_64
group: 'The options are:'
description: Set output machine type
provenance:
sources:
- help-text
- spellings:
- --input-type
value_kind: Optional
optional_join: separate
choices:
- none
- rel
- exec
- dyn
group: 'The options are:'
description: Set input file type
provenance:
sources:
- help-text
- spellings:
- --output-type
value_kind: Optional
optional_join: separate
choices:
- none
- rel
- exec
- dyn
group: 'The options are:'
description: Set output file type
provenance:
sources:
- help-text
- spellings:
- --input-osabi
value_name: none|HPUX|NetBSD|GNU|Linux|Solaris|AIX|Irix|FreeBSD|TRU64|Modesto|OpenBSD|OpenVMS|NSK|AROS|FenixOS
value_kind: Optional
optional_join: separate
group: 'The options are:'
description: Set input OSABI
provenance:
sources:
- help-text
- spellings:
- --output-osabi
value_name: none|HPUX|NetBSD|GNU|Linux|Solaris|AIX|Irix|FreeBSD|TRU64|Modesto|OpenBSD|OpenVMS|NSK|AROS|FenixOS
value_kind: Optional
optional_join: separate
group: 'The options are:'
description: Set output OSABI
provenance:
sources:
- help-text
- spellings:
- --input-abiversion
value_name: 0-255
value_kind: Optional
optional_join: separate
group: 'The options are:'
description: Set input ABIVERSION
provenance:
sources:
- help-text
- spellings:
- --output-abiversion
value_name: 0-255
value_kind: Optional
optional_join: separate
group: 'The options are:'
description: Set output ABIVERSION
provenance:
sources:
- help-text
- spellings:
- --enable-x86-feature
value_kind: Optional
optional_join: separate
choices:
- ibt
- shstk
- lam_u48
- lam_u57
group: 'The options are:'
description: Enable x86 feature
provenance:
sources:
- help-text
- spellings:
- --disable-x86-feature
value_kind: Optional
optional_join: separate
choices:
- ibt
- shstk
- lam_u48
- lam_u57
group: 'The options are:'
description: Disable x86 feature
provenance:
sources:
- help-text
- spellings:
- -h
- --help
group: 'The options are:'
description: Display this information
provenance:
sources:
- help-text
- spellings:
- -v
- --version
group: 'The options are:'
description: Display the version number of elfedit
provenance:
sources:
- help-text
provenance:
sources:
- help-text
confidence: 0.5
children_filled: true
24 changes: 24 additions & 0 deletions corpus/elfedit/2.42/help.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Usage: elfedit <option(s)> elffile(s)
Update the ELF header of ELF files
The options are:
--input-mach [none|i386|iamcu|l1om|k1om|x86_64]
Set input machine type
--output-mach [none|i386|iamcu|l1om|k1om|x86_64]
Set output machine type
--input-type [none|rel|exec|dyn]
Set input file type
--output-type [none|rel|exec|dyn]
Set output file type
--input-osabi [none|HPUX|NetBSD|GNU|Linux|Solaris|AIX|Irix|FreeBSD|TRU64|Modesto|OpenBSD|OpenVMS|NSK|AROS|FenixOS]
Set input OSABI
--output-osabi [none|HPUX|NetBSD|GNU|Linux|Solaris|AIX|Irix|FreeBSD|TRU64|Modesto|OpenBSD|OpenVMS|NSK|AROS|FenixOS]
Set output OSABI
--input-abiversion [0-255] Set input ABIVERSION
--output-abiversion [0-255] Set output ABIVERSION
--enable-x86-feature [ibt|shstk|lam_u48|lam_u57]
Enable x86 feature
--disable-x86-feature [ibt|shstk|lam_u48|lam_u57]
Disable x86 feature
-h --help Display this information
-v --version Display the version number of elfedit
Report bugs to <https://sourceware.org/bugzilla/>
20 changes: 20 additions & 0 deletions corpus/elfedit/2.42/meta.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[bless]
provenance = "agent"

[tool]
name = "elfedit"
version = "2.42"
platform = "ubuntu-24.04 (aarch64)"
captured_with = "mandible 0.9.0 --report"

[[capture]]
argv = ["elfedit", "--help"]
stdout = "help.txt"
exit_code = 0

[contract]
expected_framework = "generic"
must_describe_root = ["Update the ELF header of ELF files"]
must_not_contain_usage_text = ["Update the ELF header"]
must_not_contain_positionals = ["ELF"]
must_contain_positionals = ["elffile(s)"]
2 changes: 2 additions & 0 deletions corpus/env/9.4/expected.screen
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
DESCRIPTION ────────────────────────────────────────────────────────────────
Set each NAME to VALUE in the environment and run COMMAND.

Mandatory arguments to long options are mandatory for short options too.


USAGE ──────────────────────────────────────────────────────────────────────
env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]
Expand Down
5 changes: 4 additions & 1 deletion corpus/env/9.4/expected.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: env
description: Set each NAME to VALUE in the environment and run COMMAND.
description: |-
Set each NAME to VALUE in the environment and run COMMAND.

Mandatory arguments to long options are mandatory for short options too.
usage:
- 'Usage: env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]'
positionals:
Expand Down
2 changes: 2 additions & 0 deletions corpus/expand/audit-seed4/expected.screen
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Convert tabs in each FILE to spaces, writing to standard output.

With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.


USAGE ──────────────────────────────────────────────────────────────────────
expand [OPTION]... [FILE]...
Expand Down
2 changes: 2 additions & 0 deletions corpus/expand/audit-seed4/expected.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ description: |-
Convert tabs in each FILE to spaces, writing to standard output.

With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.
usage:
- 'Usage: /usr/bin/expand [OPTION]... [FILE]...'
positionals:
Expand Down
Loading
Loading
0