afnanenayet / diffsitter

A tree-sitter based AST difftool to get meaningful semantic diffs
MIT License
1.59k stars 29 forks source link

[BUG] README 'usage' section has incorrect command for dump-default-config #815

Closed 0xdevalias closed 7 months ago

0xdevalias commented 7 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Look at the 'usage' section of the README: https://github.com/afnanenayet/diffsitter#usage
  2. Copy the suggested command for dumping the default config: diffsitter --cmd dump_default_config
  3. Run it and notice that you get an error (see below)
  4. Eventually bruteforce your way to discovering the actual command (see below)
  5. Wonder why this isn't in the -h / --help
  6. Go back and look and then realise it is but you just missed it somehow
⇒ diffsitter --cmd dump_default_config
error: unexpected argument '--cmd' found

  tip: to pass '--cmd' as a value, use '-- --cmd'

Usage: diffsitter [OPTIONS] [OLD] [NEW] [COMMAND]

For more information, try '--help'.

⇒ diffsitter -- --cmd dump_default_config
Error: Unsupported file type with no fallback command specified.

⇒ diffsitter FAKE FAKE2 dump_default_config
error: unrecognized subcommand 'dump_default_config'

  tip: a similar subcommand exists: 'dump-default-config'

Usage: diffsitter [OPTIONS] [OLD] [NEW] [COMMAND]

For more information, try '--help'.

⇒ diffsitter FAKE FAKE2 dump-default-config
{
  // ..snip..
}

⇒ diffsitter dump-default-config
{
  // ..snip..
}

Expected behavior The usage section of the docs should provide the correct command to use.

Log output/screenshots N/A

Platform: OS: N/A

Additional context I should read the help output closer before trying to bruteforce my way to a solution.

0xdevalias commented 7 months ago

PR for docs fix: