Skip to content

Option to only complete flags when - has been typed #32

@mrliptontea

Description

@mrliptontea

First of all, thank you for your excellent projects, bashly and completely. They are fantastic and certainly made creating Bash tools more bearable.

Seeing the improvements made to flag autocompletion from bashly-framework/bashly#224, I wonder if it would be possible, maybe as an opt-in setting, to make the completion only output flags when the cursor has stopped at -, and output no flags otherwise.

I think this behaviour is pretty common and used in many tools' completions. In essence:

# complete flags:
mytool -<TAB>
mytool --<TAB>
# complete other stuff, i.e. files, folders, etc.
mytool <TAB>

What do you think?

On a separate note, normally shellcheck complains about read without -r, I'm unsure if it should be included here?
See https://www.shellcheck.net/wiki/SC2162

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions