Skip to content

Conversation

lread
Copy link
Contributor

@lread lread commented Apr 14, 2025

Switched from clojure.tools/cli to org.babashka/cli for command line
parsing.

Usage help is now shown on request, via --help for -M usage
or :help true for -T and -X tool usage, and on usage error.

Usage help shows appropriate option syntax for -M vs -T usage.

Help is also shown on usage error.

Now emit a warning on deprecated option usage (currently only --no-diff
is deprecated).

I did not realize all multi value args support : separator syntax.
Updated README accordingly.

Cli tests updated accordingly and I brought in nubank's matcher
combinators to make comparisons easy to write and error diffs easy to read.

After I tackle #274, I'll incorporate these checks for lein plugin usage.

Closes #280

lread added 11 commits April 12, 2025 23:29
Switched from clojure.tools/cli to org.babashka/cli for command line
parsing.

Usage help is now shown on request, via `--help` for -M usage
or `:help true` for -T and -X tool usage, and on usage error.

Usage help shows appropriate option syntax for -M vs -T usage.

Help is also shown on usage error.

Now emit a warning on deprecated option usage (currently only --no-diff
is deprecated).

I did not realize all multi value args support `:` separator syntax.
Updated README accordingly.

Cli tests updated accordingly and I brought in nubank's matcher
combinators to make comparisons easy to write and error diffs easy to read.

After I tackle liquidz#274, I'll incorporate these checks for lein plugin usage.

Closes liquidz#280
test now has deps, bring in test alias
brought it over from bb cli, but don't need it.
Happily get rid of our antq.cli.table ns
@lread
Copy link
Contributor Author

lread commented Apr 14, 2025

Hi @liquidz when you find some time, looking forward to learning what you think.

With babashka cli, it is relatively easy to add usage help, so did that.

-M usage:

$ clojure -M -m antq.core --help
antq ARG USAGE:
 [options..]

     --upgrade                                  Upgrade outdated versions interactively
     --force                                    Use with upgrade for non-interactive upgrade
     --exclude=<artifact-name[@version]>        Skip version checking for specified artifacts or versions
                                                 for multiple, repeat arg, ex: --exclude=art1 [email protected]
                                                 or use colon separators: --exclude=art1:[email protected]
 -d, --directory=<directory>                    Add search paths for projects (in addition to ./)
                                                 default: ./
                                                 for multiple, repeat arg, ex: --directory=./dira --directory=./dirb
                                                 or use colon separators: --directory=./dira:./dirb
     --focus=<artifact-name>                    Only version check for specified artifacts
                                                 for multiple, repeat arg, ex: --focus=art1 --focus=art2
                                                 or use colon separators: --focus=art1:art2
     --skip=<babashka|boot|circle-ci            Skip specified project file types
             |clojure-cli|github-action          for multiple, repeat arg, ex: --format=pom --format=gradle
             |gradle|leiningen|pom|shadow-cljs>  or use colon separators: --format=pom:gradle
     --error-format=<error format>              Customize output for outdated dependencies
     --reporter=<table|format|json|edn>         Report output format
                                                 default: table
     --download                                 Download updated dependencies
     --ignore-locals                            Ignore versions installed in your local maven repository
     --check-clojure-tools                      Detect outdated clojure tools in ~/.clojure/tools
     --no-changes                               Skip checking changes between deps versions
     --changes-in-table                         Show changes URLs in table when using table reporter
     --transitive                               Scan outdated transitive deps
 -h, --help                                     Show usage help

-T usage:

$ clojure -Tantq outdated :help true 
antq ARG USAGE:
 [options..]

     :upgrade                                  Upgrade outdated versions interactively
     :force                                    Use with upgrade for non-interactive upgrade
     :exclude <artifact-name[@version]>        Skip version checking for specified artifacts or versions
                                                for multiple, use a vector, ex: '[art1 [email protected]]'
                                                or use colon separators: art1:[email protected]
 :d, :directory <directory>                    Add search paths for projects (in addition to ./)
                                                default: ./
                                                for multiple, use a vector, ex: '[./dira ./dirb]'
                                                or use colon separators: ./dira:./dirb
     :focus <artifact-name>                    Only version check for specified artifacts
                                                for multiple, use a vector, ex: '[art1 art2]'
                                                or use colon separators: art1:art2
     :skip <babashka|boot|circle-ci            Skip specified project file types
            |clojure-cli|github-action          for multiple, use a vector, ex: '[pom gradle]'
            |gradle|leiningen|pom|shadow-cljs>  or use colon separators: pom:gradle
     :error-format <error format>              Customize output for outdated dependencies
     :reporter <table|format|json|edn>         Report output format
                                                default: table
     :download                                 Download updated dependencies
     :ignore-locals                            Ignore versions installed in your local maven repository
     :check-clojure-tools                      Detect outdated clojure tools in ~/.clojure/tools
     :no-changes                               Skip checking changes between deps versions
     :changes-in-table                         Show changes URLs in table when using table reporter
     :transitive                               Scan outdated transitive deps
 :h, :help                                     Show usage help

@lread
Copy link
Contributor Author

lread commented Apr 26, 2025

Hi @liquidz, I expect you are busy with life and other things.
Let me know what you think after you've had a chance to take a peek.

@lread
Copy link
Contributor Author

lread commented Jul 22, 2025

Hi @liquidz! I am still happy to bring this one to completion, if you find some time/interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider validating clojure tools cli and lein antq plugin options
1 participant