Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Short flags throw error #1

Open
hellerve opened this issue Feb 26, 2023 · 1 comment
Open

Short flags throw error #1

hellerve opened this issue Feb 26, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@hellerve
Copy link
Member

Tested with the following program pieced together from the README:

(load "[email protected]:carpentry-org/clig@main")

(def p (Clig.new @"my-program" @"doesn't do anything interesting"))

(def my-bool-flag (Clig.bool-flag @"force" 
                                  (Maybe.Just @"b") 
                                  @"false" 
                                  @"abandon all safety"))
(def my-int-flag (Clig.int-flag @"count" 
                                (Maybe.Nothing) 
                                @"1" 
                                @"repeat n times"))

(defn main []
  (do (Clig.add-flag &p &my-bool-flag)
      (Clig.add-flag &p &my-int-flag)
      (match (Clig.parse &p true)
        (Result.Error err) (IO.println &(str err))
        (Result.Success _)
          (IO.println "hi")
        )))

Unfortunately, when trying to provide the program with the short flag b, I get the following output:

unknown flag force

This seems to only happen with short flags.

Cheers

@hellerve hellerve added the bug Something isn't working label Feb 26, 2023
@scolsen scolsen self-assigned this Feb 27, 2023
@scolsen
Copy link
Member

scolsen commented Feb 27, 2023

Thanks for filing this! I'll try to get to it this week if I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants