import { paramsOptions , IParamsArgs } from "./paramsOptions" ; import { NetworkName , networkNames } from "../networks" ; import { ICliCommandOptions , readFile } from "../util" ; interface IGlobalSingleArgs { rootDir : string ; network : NetworkName ; paramsFile : string ; preset : string ; } export const defaultNetwork = "mainnet" ; const globalSingleOptions = { rootDir : { description : "Lodestar root directory" , type : "string" , } , network : { description : "Name of the Eth2 chain network to join" , type : "string" , default : defaultNetwork , choices : networkNames , } , paramsFile : { description : "Network configuration file" , type : "string" , } , preset : { hidden : true , type : "string" , } , } ; export const rcConfigOption = [ "rcConfig" , "RC file to supplement command line args, accepted formats: .yml, .yaml, .json" , ( configPath ) : Record < string , unknown > => readFile ( configPath , [ "json" , "yml" , "yaml" ] ) , ] ; export type IGlobalArgs = IGlobalSingleArgs & IParamsArgs ; export const globalOptions = { ... globalSingleOptions , ... paramsOptions , } ;