import autojump from "./autojump" ; const completionSpec = { name : "j" , ... autojump , args : { name : "directory" , description : "Directory to jump to" , isVariadic : true , generators : { script : 'cat "$HOME"/Library/autojump/autojump.txt' , postProcess : ( out , ctx ) => { const lines = out . split ( "\n" ) . map ( ( line ) => { const [ weight , dir ] = line . split ( "\t" ) ; return { weight : Number ( weight ) , dir , } ; } ) ; const args = ctx . slice ( 1 , ctx . length - 1 ) ; const filtered = lines . filter ( ( { dir } ) => args . every ( ( arg ) => dir . includes ( arg ) ) ) ; return filtered . map ( ( { weight , dir } ) => { const splitPath = dir . split ( "/" ) ; const name = splitPath [ splitPath . length - 1 ] ; if ( ! args . includes ( name ) ) { return { name , description : dir , priority : 75 + weight , } ; } } ) ; } , } , } , } ; export default completionSpec ;