🔥 쉘 완성 스크립트 생성하기

66자
1분

명령줄 도구에 --generate-completion-script 옵션을 전달하면 해당 쉘용 완성 스크립트가 생성됩니다. 예를 들어 Bash 쉘용 완성 스크립트를 생성하려면 다음 명령을 실행합니다.

text
$ example --generate-completion-script bash
#compdef example
local context state state_descr line
_example_commandname="example"
typeset -A opt_args


_example() {
    integer ret=1
    local -a args
    ...
}


_example
text
$ example --generate-completion-script bash
#compdef example
local context state state_descr line
_example_commandname="example"
typeset -A opt_args


_example() {
    integer ret=1
    local -a args
    ...
}


_example

위 명령을 실행하면 Bash용 완성 스크립트가 출력됩니다. Z 쉘이나 Fish 쉘용 완성 스크립트도 마찬가지로 생성할 수 있습니다.

YouTube 영상

채널 보기
Pro펑터, 입력과 출력을 동시에 다루는 펑터 | 프로그래머를 위한 카테고리 이론
NestJS 커스텀 데코레이터 인자 전달 및 파이프 검증 활용법 | NestJS 가이드
관점 지향 로깅 인터셉터 구현 및 전역 바인딩 전략 | NestJS 가이드
함수 객체의 보편적 구성 | 프로그래머를 위한 카테고리 이론
class-validator 와 DTO | NestJS 가이드
NestJS 인터셉터란? | NestJS 가이드
입력을 전처리하는 Functor - Contravariant와 contramap 이해하기 | 프로그래머를 위한 카테고리 이론
NestJS 커스텀 데코레이터, createParamDecorator 사용 | NestJS 가이드