+
Skip to content

Short flags throw error #1

@hellerve

Description

@hellerve

Tested with the following program pieced together from the README:

(load "git@github.com: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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载