const completionSpec = { name : "mask" , generateSpec : async ( tokens , executeShellCommand ) => { var maskfileLocationIdx = tokens . indexOf ( "--maskfile" ) ; var out ; if ( maskfileLocationIdx < 0 || maskfileLocationIdx + 3 > tokens . length ) { out = await executeShellCommand ( "cat maskfile.md 2> /dev/null" ) ; } else { out = await executeShellCommand ( `\cat ${ tokens [ maskfileLocationIdx + 1 ] } 2> /dev/null` ) ; } if ( ! out ) return { name : "null" } ; return { name : "mask" , subcommands : out . match ( /##.*/g ) . map ( ( elm ) => { return { name : elm . slice ( 3 ) , } ; } ) , } ; } , } ; export default completionSpec ;