Skip to content

[Bug]: Command line: --option=value, an option taken as a value, no "--", Windows paths in help #1709

Open

Description

@yavuzmeteafsar

What happened?

Four small things in the command-line parser (CliOptions.Parse) and the help text (Help.cs). Reproduced with filee 2.3.0 on macOS; the same code is unchanged on main (cf96cd5).

  1. --option=value is refused: --to=jpg gives "Unknown option '--to=jpg'". Many tools accept both forms, and scripts often build arguments that way.
  2. An option that needs a value takes the next argument even when it is another option. filee convert a.png --to jpg -o --json saves into a folder named --json and prints text instead of JSON.
  3. There is no -- to end the options, so a file named like --draft.md or -1 can't be given, and -- itself is "Unknown option '--'".
  4. filee help watch says <folder>\converted and <folder>\originals on macOS and Linux too, and the examples in filee help use D:\Scans and D:\Inbox on every platform.

What did you expect?

  1. --to=jpg works like --to jpg, for every option that takes a value.
  2. When the value is itself one of the options, the existing error: "-o needs a value."
  3. Everything after -- is a file or folder.
  4. The help uses the platform's path separator, and the examples use paths of the platform (for example ~/Scans on macOS and Linux).

Steps to reproduce

  1. filee convert photo.png --to=jpg
    → filee: Unknown option '--to=jpg'.
  2. filee convert photo.png --to jpg -o --json
    → ok photo.png -> --json/photo.jpg (a folder named "--json" is created, no JSON)
  3. filee convert -- --draft.md --to pdf
    → filee: Unknown option '--'.
  4. filee help watch (on macOS)
    → -o, --output Where converted files go (default: \converted)

Files involved

None needed. I'd like to fix this: all four in one PR, with tests in Filee.Cli.Tests.

Filee version

2.3.0 (reproduced); code unchanged on main cf96cd5

Operating system

macOS

Engines page status

No response

Log


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions