Skip to content

fix/enhancement: age-inspect indefinitely hanging and also improvements to usage info and flags for both age-inspect and age-keygen#712

Open
Turmaxx wants to merge 2 commits into
FiloSottile:mainfrom
Turmaxx:inspect
Open

Conversation

@Turmaxx
Copy link
Copy Markdown

@Turmaxx Turmaxx commented May 23, 2026

This PR mainly fixes an issue where age-inspect would hang indefinitely, when invoked alone without arguments or a piped input. but also improves the usage information and version flags a bit for different age CLI binaries.

  • adds a v as an alternative version flag to age-inspect and age-keygen.
  • improves the usage information, by adding alternate usage to age-inspect.

In relation to age-inspect, the changes I've made wont affect previous behavior.

$ age-inspect
Click to expand output
Usage:
    age-inspect [INPUT]
    age-inspect [--json] [INPUT]

Options:
    --json                      Output machine-readable JSON.
    -v, --version               Print the version.

INPUT defaults to standard input. "-" may be used as INPUT to explicitly
read from standard input.
$ age-inspect test.age
Click to expand output
test.age is an age file, version "age-encryption.org/v1".

This file is ASCII-armored.

This file is encrypted to the following recipient types:
  - "scrypt"

This file uses post-quantum encryption.

Size breakdown (assuming it decrypts successfully):

    Header                       150 bytes
    Armor overhead              1481 bytes
    Encryption overhead           32 bytes
    Payload                     3805 bytes
                        -------------------
    Total                       5468 bytes

Tip: for machine-readable output, use --json.
$ age-inspect --json test.age
Click to expand output
{
    "version": "age-encryption.org/v1",
    "postquantum": "yes",
    "armor": true,
    "stanza_types": [
        "scrypt"
    ],
    "sizes": {
        "header": 150,
        "armor": 1481,
        "overhead": 32,
        "min_payload": 3805,
        "max_payload": 3805,
        "min_padding": 0,
        "max_padding": 0
    }
}
$ cat test.age | age-inspect
Click to expand output
<stdin> is an age file, version "age-encryption.org/v1".

This file is ASCII-armored.

This file is encrypted to the following recipient types:
  - "scrypt"

This file uses post-quantum encryption.

Size breakdown (assuming it decrypts successfully):

    Header                       150 bytes
    Armor overhead              1481 bytes
    Encryption overhead           32 bytes
    Payload                     3805 bytes
                        -------------------
    Total                       5468 bytes

Tip: for machine-readable output, use --json.
$ cat test.age | age-inspect --json
Click to expand output
{
    "version": "age-encryption.org/v1",
    "postquantum": "yes",
    "armor": true,
    "stanza_types": [
        "scrypt"
    ],
    "sizes": {
        "header": 150,
        "armor": 1481,
        "overhead": 32,
        "min_payload": 3805,
        "max_payload": 3805,
        "min_padding": 0,
        "max_padding": 0
    }
}

Turmaxx added 2 commits May 23, 2026 13:04
- added `-v` flag
- updated usage information / help message
- added `else` logic to fix age-inspect hanging when invoked seperately,
it prints the usage information, when invoked with an age files it
inspects it and also when pipes it inspects it.
- added `-v` flag
- updated usuage information to reflect those changes
@Turmaxx
Copy link
Copy Markdown
Author

Turmaxx commented May 25, 2026

You probably have to update go.mod @FiloSottile, that's why the CI failed.

@Turmaxx Turmaxx changed the title fix: age-inspect indefinitely hanging and also improves usage info and flags fix: age-inspect indefinitely hanging and also improves and usage info and flags for both age-inspect and age-keygen May 27, 2026
@Turmaxx Turmaxx changed the title fix: age-inspect indefinitely hanging and also improves and usage info and flags for both age-inspect and age-keygen fix/enhancement: age-inspect indefinitely hanging and also improves and usage info and flags for both age-inspect and age-keygen May 27, 2026
@Turmaxx Turmaxx changed the title fix/enhancement: age-inspect indefinitely hanging and also improves and usage info and flags for both age-inspect and age-keygen fix/enhancement: age-inspect indefinitely hanging and also improvements to usage info and flags for both age-inspect and age-keygen May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant