fsprojects / Argu

A declarative CLI argument parser for F#
https://fsprojects.github.io/Argu
MIT License
453 stars 75 forks source link

Parameter without an option #130

Closed maccth closed 9 months ago

maccth commented 5 years ago

Hi, this is a query rather than a bug report. Is there a way to check for a command line parameter that doesn't have an option? For example,

./myApp param

and then check for the param using Argu. What is the best way to do this? I've seen #85, has there been any updates since?

Cheers

Ciantic commented 5 years ago

There is already one? with [<MainCommand>]

type CLIArguments =
    | [<MainCommand>] ImageFile of IMAGEFILE:string

It's just printed weird way in the help btw:

USAGE: gadget.exe [--help] [--size <size>] [<IMAGEFILE>]

IMAGEFILE:
    <IMAGEFILE>           crappery

OPTIONS:

    --size, -s <size>     size of new image file

The IMAGEFILE is repeated as a header of sorts there.

bartelink commented 9 months ago

@maccth @ciantic I'm not clear what the ask/proposal is here. Can this be closed and/or can the OP be expanded on please?

bartelink commented 9 months ago

Closing for now; Feel free to re-open with details, but I suspect there is already an in the box way to do it, if the ask can be defined?