denisidoro / navi

An interactive cheatsheet tool for the command-line
Apache License 2.0
14.63k stars 491 forks source link

fails the tldr integration with tealdeer #845

Closed phanirithvij closed 5 months ago

phanirithvij commented 1 year ago

Describe the bug $ navi --tldr tldr

Hey, listen! navi encountered a problem.
Do you think this is a bug? File an issue at https://github.com/denisidoro/navi.

Caused by:
    Failed to call:
    tldr tldr --markdown

    Output:

    Error:
    error: Found argument '--markdown' which wasn't expected, or isn't valid in this context

        If you tried to supply `--markdown` as a value rather than a flag, use `-- --markdown`

    USAGE:
        tldr <COMMAND|--render <FILE>>

    For more information try --help

    Note:
    Please make sure you're using a version that supports the --markdown flag.
    If you are already using a supported version you can ignore this message.
    The tldr client written in C (the default one in Homebrew) doesn't support markdown files, so navi can't use it.
    The client written in Rust is recommended. The one available in npm works, too.

To Reproduce Steps to reproduce the behavior:

  1. Install tealdeer (cargo install tealdeer)
  2. navi --tldr tldr
  3. See error

Expected behavior navi --tldr command should work with tealdeer (the rust client) as well as it does with the official python impmentation (tldr)

So either tealdeer should have a working --markdown/-m flag (or) navi should use --raw flag in case tealdeer with some detection logic (or) navi should stop recommending tealdeer or the 'rust client' in the logs and elsewhere in the codebase.

Versions:

Additional context I've opened an issue over at https://github.com/dbrgn/tealdeer/issues/321 as once the markdown flag used to exist and they removed it after an year of deprecation notice and are stubborn on not reverting that change so far and the discussion hasn't yet reached any meaninful conclusion.

I think either the --markdown/-m or --raw/-r or some other different name (--x_long,-x_short) flag should be added to the tldr client specification as almost all the client implementations have a -m flag as of now except tealdeer.

Please let me know if I have to open an issue over at tldr-pages/tldr regarding adding the cli flag to the client specification or something can be worked out without this.

On a side note I think tealdeer is objectively superior if not for the removal of this -m flag which broke the navi integration.

welcome[bot] commented 1 year ago

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)