import { Arguments , KResponse , Registrar } from '@kui-shell/core' ; import { isUsage , doHelp , defaultFlags , KubeOptions } from '@kui-shell/plugin-kubectl' ; import raw from './controller/raw' ; import { projectList , projectListView } from './controller/odo/project/list' ; import catalogListComponents from './controller/odo/catalog/list/components' ; import catalogListServices from './controller/odo/catalog/list/services' ; function withHelp ( handler ) { return ( args ) => { if ( isUsage ( args ) ) { return doHelp ( 'odo' , args ) ; } return handler ( args ) ; } ; } export default ( registrar ) => { raw ( registrar ) ; registrar . listen ( '/odo/project/list' , withHelp ( projectList ) , Object . assign ( { } , defaultFlags , { viewTransformer : projectListView } ) ) ; registrar . listen ( '/odo/catalog/list/components' , withHelp ( catalogListComponents ) , defaultFlags ) ; registrar . listen ( '/odo/catalog/list/services' , withHelp ( catalogListServices ) , defaultFlags ) ; } ;