Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on May 21, 2014
  1. @seancorfield

    Add CONTRIBUTING.md

    seancorfield authored
Commits on Apr 26, 2014
  1. @guns
Commits on Apr 24, 2014
  1. @guns

    Re-implement :no-defaults option to avoid breaking :assoc-fn

    guns authored
    :assoc-fn is called with the value of the current option-map, which is
    assumed to contain the default value of the option. This patch changes
    :no-defaults to call select-keys on the option map before returning to
    the user.
  2. @guns
  3. @guns

    Add :no-defaults option to parse-opts

    guns authored
    While attempting to compile options from multiple sources, I discovered
    that it was difficult to extract only the subset of options actually
    specified in a given input line.
    
    With :no-defaults and get-default-options, constructing an option map is
    much more flexible than before.
  4. @guns

    Add public function clojure.tools.cli/get-default-options

    guns authored
    Users should be able to extract the default map from their own option
    vectors without calling parse-opts with an empty args vector.
  5. @guns
  6. @guns

    Move normalize-args into "Legacy API" section

    guns authored
    This function is a shim for the old cli/cli function.
  7. @guns

    Use `options-specs` in arglists to refer to option vectors

    guns authored
    As opposed to compiled option specification maps.
  8. @guns

    Add ns docstrings

    guns authored
  9. @guns
  10. @guns

    Prevent noisy warning in test case

    guns authored
    We now have a separate test for unknown keys.
Commits on Apr 22, 2014
  1. @guns

    Remove uniqueness constraint on :id

    guns authored
    Multiple options for the same :id makes some sense:
    
      [["-v" "--verbosity"
        :default 3
        :parse-fn #(Integer/parseInt %)]
       ["-q" "--quiet"
        :id :verbosity
        :parse-fn (constantly 0)]]
    
    However, multiple :default entries for the same :id does not make sense,
    so it is prohibited.
    
    The identity constraint on :id remains.
  2. @guns

    Clarify unknown keys warning

    guns authored
  3. @guns

    Support multiple validations

    guns authored
    Jean Niklas L'orange, in TCLI-9:
    
    > In many cases, I have input arguments where I want to perform multiple
    > validations, and return different error messages based upon that.
    > Would it be reasonable to have multiple validation functions, or being
    > able to have a validation function returning nil if no errors exists,
    > and an error string if not?
    
    This is an implemenation of the first suggestion, multiple validation
    functions.
    
    The :validation entry can now have multiple entries, which are
    partitioned into pairs, then split into the vector entries
    :validation-fn and :validation-msg. It would be nice to have
    a pluralized key name here, but we decline this for backwards
    compatibility.
    
    Non-collection values of :validate-fn and :validate-msg continue to be
    supported by conditional wrapping.
    
    Example:
    
        [["-f" "--file PATH"
          :parse-fn io/file
          :validate [#(.exists %) "File does not exist"
                     #(.isFile %) "Path is not a regular file"
                     #(.canRead %) "File is unreadable"]]]
    
    Addresses TCLI-9.
  4. @guns

    Warn about unknown option entries at development time

    guns authored
    I have noticed some confusion about the new API. For instance, users are
    using the old :flag entry from cli/cli to try to denote that an option
    is a boolean flag.
    
    Hopefully, a friendly warning during compile time will encourage a
    closer look at the documentation.
  5. @guns

    Update dev project dependencies

    guns authored
Commits on Feb 18, 2014
  1. @guns

    Prefer aliases over refers + minor docstring changes

    guns authored
    A stylistic change to avoid :use in the ns declaration.
Commits on Jan 2, 2014
  1. @guns

    Update README with 0.3.1 release

    guns authored
  2. @guns
  3. @guns

    Refactor summarize for clarity

    guns authored
  4. [maven-release-plugin] prepare for next development iteration

    Hudson @ build.clojure.org authored
  5. [maven-release-plugin] prepare release tools.cli-0.3.1

    Hudson @ build.clojure.org authored
  6. @guns

    Prepare for 0.3.1 release

    guns authored
  7. @guns

    Synchronize TCLI-7 with CLJS version

    guns authored
    The patch is changed a bit to handle the empty-option edge case
    directly.
  8. @jafingerhut @guns
  9. @hugoduncan @guns

    Fix summarize so it works with no options

    hugoduncan authored guns committed
    Summarize was throwing an exception when called with no options.
Commits on Dec 24, 2013
  1. @guns

    Update README with note about error handling

    guns authored
    `parse-opts` does not throw on parse errors, unlike cli/cli, so it's
    worth emphasizing the change.
Commits on Dec 15, 2013
  1. [maven-release-plugin] prepare for next development iteration

    Hudson @ build.clojure.org authored
  2. [maven-release-plugin] prepare release tools.cli-0.3.0

    Hudson @ build.clojure.org authored
  3. @guns
Commits on Dec 11, 2013
  1. @guns
Commits on Dec 10, 2013
  1. [maven-release-plugin] prepare for next development iteration

    Hudson @ build.clojure.org authored
  2. [maven-release-plugin] prepare release tools.cli-0.3.0-beta1

    Hudson @ build.clojure.org authored
  3. @guns
Something went wrong with that request. Please try again.