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

Programmatic API guide for picocli 4.1 (#885) #889

Merged
merged 1 commit into from
Dec 1, 2019
Merged

Programmatic API guide for picocli 4.1 (#885) #889

merged 1 commit into from
Dec 1, 2019

Conversation

deining
Copy link
Contributor

@deining deining commented Nov 30, 2019

No description provided.

@codecov-io
Copy link

codecov-io commented Nov 30, 2019

Codecov Report

Merging #889 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #889   +/-   ##
=========================================
  Coverage     92.84%   92.84%           
  Complexity      388      388           
=========================================
  Files             2        2           
  Lines          5812     5812           
  Branches       1512     1512           
=========================================
  Hits           5396     5396           
  Misses          205      205           
  Partials        211      211

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 389e46f...a193749. Read the comment docs.

@remkop remkop merged commit 4138a54 into remkop:master Dec 1, 2019
@remkop
Copy link
Owner

remkop commented Dec 1, 2019

Merged. Thank you!

I will probably replace the old 3.0-programmatic-api document with a link to the latest one.

@remkop
Copy link
Owner

remkop commented Dec 1, 2019

Thanks a lot for the PR! Awesome work!

I changed it a bit to use lambdas which is nice and concise.

I renamed the file to remove the version number and redirect the old https://picocli.info/picocli-3.0-programmatic-api.html to the new doc.
That should make maintenance easier in the future.

I also shortened the first example and expanded the example in the Execute section (near the end).

Let me know what you think.

@deining
Copy link
Contributor Author

deining commented Dec 1, 2019

I changed it a bit to use lambdas which is nice and concise.
I also shortened the first example and expanded the example in the Execute section (near the end).

Great improvements, thanks for reviewing my PR.
Glad to see the document updated now.

One small glitch I came across:

The usage help message of the first example states:

Usage: <main class> [-hV] [-c=COUNT] FILES...
      FILES...        The files to process
  -c, --count=COUNT   number of times to execute
  -h, --help          Show this help message and exit.
  -V, --version       Print version information and exit.

If I run the command and specify --help as only argument, I'm getting no output (expected: help messaage).
If I run the command and specify --help foo as commad line arguments, I'm getting as output: 0 foo

Is this the intended behaviour?

@remkop
Copy link
Owner

remkop commented Dec 1, 2019

@deining Good catch! That was a bug: our IExecutionHandler should also handle requests for help. Fixed now.

@remkop remkop added this to the 4.1.2 milestone Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants