Skip to content

CLI: improve magic-file-not-found error message with actionable suggestions #49

@unclesp1d3r

Description

@unclesp1d3r

Summary

The CLI error message when no magic file is found should match the format specified in Core Flow 3, providing clear options for the user.

Context

Per Core Flow 3, the error should display:
```
Error: Magic file not found
No magic file found at standard locations.

Options:
--use-builtin Use built-in rules (limited file type support)
--magic-file PATH Specify a custom magic file location

Example: rmagic --use-builtin sample.bin
```

Current state: Error message is less structured and doesn't list available options with examples.

Acceptance Criteria

  • Error message includes "Options:" section listing --use-builtin and --magic-file
  • Includes a concrete example command
  • Message is written to stderr
  • Test verifies error message format

Files to Modify

  • src/main.rs - Update magic file not found error handling

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliCommand-line interface and toolsenhancementNew feature or requestpriority:lowNice to have, can defer

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions