import { IParsedArguments } from "arguments" ; /** Provides a static method for parsing command-line arguments. */ export default { param args returns parse ( args ) { const result = { openInDevelopment : false , verbose : false , version : false } ; args . forEach ( arg => { if ( versionRequested ( arg ) ) { result . version = true ; } else if ( verboseRequested ( arg ) ) { result . verbose = true ; } else if ( openInDevelopmentRequested ( arg ) ) { result . openInDevelopment = true ; } } ) ; return result ; } } ; param arg returns function verboseRequested ( arg ) { return arg === "--verbose" || arg === "-V" ; } param arg returns function versionRequested ( arg ) { return arg === "--version" || arg === "-v" ; } function openInDevelopmentRequested ( arg ) { return arg === "--dev" || arg === "-d" ; }