question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support indexing relative to 'last' position (was: Unbounded arity param)

See original GitHub issue

Is it possible to use unbounded arity parameter without being the last parameters ? The following code

	@Parameters(index = "0", description = "Folder")
	private String folder;

	@Parameters(index = "1", arity = "1...*", description = "Source paths")
	private String [] sources;

	@Parameters(index = "2", description = "Destination folder path")
	private String destination;

is throwing picocli.CommandLine$MissingParameterException: Missing required parameter: <destination> when called with MyClass folder source1 source2 source3 destination

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
remkopcommented, Apr 24, 2018

Thanks for raising this topic. I’ve started to think it may be worth supporting some index = last syntax in the future. That would allow something like:

@Parameters(index = “0..$-1”)
String[] sources;

@Parameters(index = “$”)
String destination;

The parsing logic for this is not straightforward though so this will be something for a future release.

0reactions
remkopcommented, Feb 15, 2022

While this is a nice idea, it turns out this is actually non-trivial to implement. I don’t see myself working on this in the near future. Closing this ticket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Indexing Reference.pdf - CMOD.wiki
OnDemand includes a complete set of information to help you plan for, ... the first page and the last index value on the...
Read more >
Query Expressions - Django documentation
Django supports negation, addition, subtraction, multiplication, division, modulo arithmetic, and the power operator on query expressions, using Python ...
Read more >
Width independent functions - verilog - Stack Overflow
E.g. a module that would accept a WIDTH parameter and actual data as an input vector. To do this, I would advise you...
Read more >
picocli - a mighty tiny command line interface
The specified path may be relative (to the current directory) or absolute. ... to a command line argument if their index matches the...
Read more >
Source code for pyomo.core.base.set
First, the lowest-level (non-abstract) Data object supports infinite sets; ... of the Set") if position > len(self): raise IndexError("Cannot advance past ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found