Skip to content

How can we declare consuming variadic arguments including - prefixed one in OptionsType #59

@norio-nomura

Description

@norio-nomura

jpsim/SourceKitten#174
Maybe that issue introduced since updating Commandant to the version that supports generating Unrecognized arguments error.

For fixing that, I tried:

    static func evaluate(m: CommandMode) -> Result<DocOptions, CommandantError<SourceKittenError>> {
        return create
            <*> m <| Option(key: "single-file", defaultValue: false, usage: "only document one file")
            <*> m <| Option(key: "module-name", defaultValue: "",    usage: "name of module to document (can't be used with `--single-file` or `--objc`)")
            <*> m <| Option(key: "objc",        defaultValue: false, usage: "document Objective-C headers")
            <*> m <| Argument(defaultValue: [], usage: "An argument list that consumes the rest of positional arguments")
    }

and got:

% cd Source/SourceKittenFrameworkTests/Fixtures
% sourcekitten doc --single-file Subscript.swift -j4 Subscript.swift
Unrecognized arguments: -j4

-j4 Subscript.swift are expected to use as arguments on launching child process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions