Я хочу знать значение опций compgen . С help compgen я могу получить справочную страницу. Но он показывает только списки опций. Там нет объяснения этому.

compgen: compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W список слов] [-F function] [-C команда] [-X filterpat] [-P префикс] [-S суффикс] [слово] Отображение возможных дополнений в зависимости от параметров.

Intended to be used from within a shell function generating possible
completions.  If the optional WORD argument is supplied, matches against
WORD are generated.

Exit Status:
Returns success unless an invalid option is supplied or an error occurs.

Особенно я хочу знать, как работает аргумент -abcdefgjksuv .

1 ответ1

0

В нижней части справочной страницы bash находится раздел SHELL BUILTIN COMMANDS, где написано

compgen [option] [word]
          Generate  possible  completion  matches  for  word according to the
          options, which may be any option accepted by the  complete  builtin
          with the exception of -p and -r, and write the matches to the stan-
          dard output.  When using the -F or -C options,  the  various  shell
          variables  set  by  the  programmable  completion facilities, while
          available, will not have useful values.

          The matches will be generated in  the  same  way  as  if  the  pro-
          grammable  completion  code had generated them directly from a com-
          pletion specification with the same flags.  If word  is  specified,
          only those completions matching word will be displayed.

          The  return  value is true unless an invalid option is supplied, or
          no matches were generated.

Чуть ниже это complete встроенная команда, которая объясняет переключатели.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .