import { CommandFlags } from '../types' ; import * as minimist from 'minimist' ; export function parseArguments ( argv , flags ) { const args = argv === process . argv ? process . argv . slice ( 2 ) : argv ; return minimist ( args , flags ) ; } export function splitArguments ( parsedArgs ) { const args = parsedArgs . _ ; const options = Object . keys ( parsedArgs ) . filter ( x => x !== '_' ) . reduce ( ( acc , key ) => { acc [ key ] = parsedArgs [ key ] ; return acc ; } , { } ) ; return [ args , options ] ; }