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

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 영상

채널 보기
NestJS 빌트인 파이프 ParseIntPipe, ParseUUIDPipe 사용하기 | NestJS 가이드
변환 파이프로 컨트롤러 코드 깔끔하게 만들기 | NestJS 가이드
NestJS 파이프가 뭔가요? 컨트롤러를 보호하는 방법 | NestJS 가이드
class-validator 와 DTO | NestJS 가이드
Writer 펑터와 클라이슬리 카테고리 | 프로그래머를 위한 카테고리 이론
Product와 Coproduct가 Bifunctor인 이유 | 프로그래머를 위한 카테고리 이론
Zod로 스키마 유효성 검사 구현하기 | NestJS 가이드
함수 타입과 Hom-Set 이해하기 | 프로그래머를 위한 카테고리 이론