logoalt Hacker News

sebtronlast Sunday at 1:16 PM1 replyview on HN

Basic completion in ksh is as easy as defining an array. From https://man.openbsd.org/ksh :

Custom completions may be configured by creating an array named ‘complete_command’, optionally suffixed with an argument number to complete only for a single argument. So defining an array named ‘complete_kill’ provides possible completions for any argument to the kill(1) command, but ‘complete_kill_1’ only completes the first argument. For example, the following command makes ksh offer a selection of signal names for the first argument to kill(1):

    set -A complete_kill_1 -- -9 -HUP -INFO -KILL -TERM

Replies

chasillast Sunday at 3:44 PM

Is this in the Korn & Bolsy ksh88 book?

Or is this ksh93 syntax that oksh back ported?

show 1 reply