import { Arguments , Capabilities , Registrar } from '@kui-shell/core' ; import { isUsage , doHelp , KubeOptions } from '@kui-shell/plugin-kubectl' ; import doExecWithPty from './exec' ; /** is the given string `str` the `helm` command? */ const isHelm = ( argv ) => { return /^helm$/ . test ( argv [ 0 ] ) && argv . every ( arg => ! /(\\|\n|;|&)/ . test ( arg ) ) ; } ; export default ( registrar ) => { if ( Capabilities . inBrowser ( ) && ! Capabilities . hasProxy ( ) ) { return ; } registrar . catchall ( ( argv ) => isHelm ( argv ) , ( args ) => isUsage ( args ) || ( args . argv . length === 1 && args . argv [ 0 ] === 'helm' ) ? doHelp ( 'helm' , args ) : doExecWithPty ( args ) , 1 ) ; } ;