Check if the command line contains any given number of flags.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Abreu f12f915fcc
Update README.md
11 months ago
functions Initial commit 11 months ago
hooks Initial commit 11 months ago
LICENSE Initial commit 11 months ago
README.md Update README.md 11 months ago

README.md

GPL License Fish Shell Version Oh My Fish Framework

contains_opts

A plugin for Oh My Fish.

Check if the command line contains any of the listed flags. If no flags are listed, it tests if the command line contains any flag at all. Most useful as a condition to trigger context aware completions for a command.

Synopsis

contains_opts a long_flag_a -oldstyle_flag_a

Example usage

complete -rc $cmd -n 'not contains_opts' -s s -l save -d 'Bookmark directory'

Only display option -s/--save if no other flags are present.

complete -rc $cmd -n 'contains_opts s save' -a "$bookmark" -d "$path"

Display bookmarks when option -s/--save is present.

Install

omf repositories add https://gitlab.com/argonautica/argonautica 
omf install contains_opts