Skip to content

Request: flag to output content without error, even if syntax/language is unknown #285

Description

@AndydeCleyre

Hi, and thanks!

I'd like an equivalent to highlight's --force[=syntax] flag:

generate output if input syntax is unknown. The fallback syntax may be set here, Plain Text is default.

Whether it allows the =syntax part is not so important. But it would be nice to be able to use gat "fearlessly," even if the provided or detected language is not supported, so that it gracefully degrades to cat-like behavior.

I frequently encounter this issue with .nt (NestedText) and .conf (ini, hcl, etc.) files.

In this case a warning may or may not be printed to stderr about the syntax being unhandled. highlight does not print any such warning.

I think the --force behavior is actually enabled by default for highlight, even when not explicitly provided. I would also be happy if this were just made the default behavior, without any new flag to trigger it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions