import dedent from 'strip-indent' ; import Arg from 'arg' ; /**
 * format
 */ export function format ( input = '' ) { return dedent ( input ) . trimRight ( ) + '\n' ; } /**
 * Wrap arg to return an error instead of throwing
 */ export function arg < T extends Arg . Spec > ( argv , spec , stopAtPositional = true , permissive = false ) { try { return Arg ( spec , { argv , stopAtPositional , permissive } ) ; } catch ( e ) { return e ; } } /**
 * Check if result is an error
 */ export function isError ( result ) { return result instanceof Error ; }