picocli: Picocli 4.6.3 : autocompletion of directory names not working anymore

I’m facing a regression with Picocli 4.6.3 : the autocompletion of filenames doesn’t work anymore.

The help of my OdsManager app:

OdsManager extractLoadOds [-hV] [-p PROPERTIES] [JOBFILE [--maxErrorsByExtraction MAX_ERRORS] [--[no-]cleanBeforeExtract] [-f | -s SINCE]] [[--commitAfter <commitLoadAfter>]

When I enter OdsManager extractLoadOds on the command line, with Picocli 4.6.2 hitting the TAB twice I was getting the possibility to autocomplete directory names for the JOBFILE parameter:

  • if I hit TAB twice I get the list of files and directories in the current directory
  • if I then type jo TAB TAB (for the existing jobs/ directory)… I get no suggestions

This was working in 4.6.2 but doesn’t work anymore in 4.6.3.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (11 by maintainers)

Most upvoted comments

@NewbieOrange , it’s still OK: completion of commands AND directory names are working!

@philgdn can you try with #1863 again?

@NewbieOrange , it’s OK now : completion of commands AND directory names are working!

Thanks four your help!

@NewbieOrange , here is the completion generated with the #1863 : SolifeOdsBatchManager_completion_1863.zip

The completion of directory names works now !

BUT it is now the commands that doesn’t work anymore.

  • if I type SolifeOdsBatchManager extract then TAB (to get extractOds or extractLoadOds) no completion is suggested
  • if I type SolifeOdsBatchManager then TAB the list of all commands is printed on the line

@remkop after some debugging, the issue seems to be caused by COMPREPLY has been set with wrong IFS; and this should be fixed by #1759.

edit: @philgdn maybe you can test with #1759?

@NewbieOrange , here is the completion generated with the #1759 : SolifeOdsBatchManager_completion_1759.zip

Unfortunately it doen’t work yet with directory names !

Here are examples (not so minimal sorry) : Examples.zip

  • SolifeOdsBatchManager_completion_462 was generated by Picocli 4.6.2 and works as expected
  • SolifeOdsBatchManager_completion_463 was generated by Picocli 4.6.3 : autocompletion don’t work for directories

To reproduce the problem (with SolifeOdsBatchManager_completion_463) in a directory containing files and directories type (for example a directory dir1 :

SolifeOdsBatchManager extractLoadOds d then TAB.

The autocompletion should complete the dir1 directory… but it doesn’t

Thank you for raising this! I will take a look.