(argv: string[])
| 895 | } |
| 896 | |
| 897 | function parseSupervisorArgs(argv: string[]): SupervisorOptions { |
| 898 | const options: SupervisorOptions = { |
| 899 | envFile: null, |
| 900 | homeDir: null, |
| 901 | stdoutLog: null, |
| 902 | stderrLog: null, |
| 903 | once: false, |
| 904 | }; |
| 905 | for (let index = 0; index < argv.length; index += 1) { |
| 906 | const arg = argv[index]; |
| 907 | const next = argv[index + 1]; |
| 908 | if (arg === '--once') { |
| 909 | options.once = true; |
| 910 | continue; |
| 911 | } |
| 912 | if (arg === '--env-file' && next) { |
| 913 | options.envFile = next; |
| 914 | index += 1; |
| 915 | continue; |
| 916 | } |
| 917 | if (arg === '--home-dir' && next) { |
| 918 | options.homeDir = next; |
| 919 | index += 1; |
| 920 | continue; |
| 921 | } |
| 922 | if (arg === '--stdout-log' && next) { |
| 923 | options.stdoutLog = next; |
| 924 | index += 1; |
| 925 | continue; |
| 926 | } |
| 927 | if (arg === '--stderr-log' && next) { |
| 928 | options.stderrLog = next; |
| 929 | index += 1; |
| 930 | continue; |
| 931 | } |
| 932 | } |
| 933 | return options; |
| 934 | } |
| 935 | |
| 936 | function normalizeDaemonSubcommand(value: string | undefined): DaemonCommandOptions['subcommand'] | null { |
| 937 | const normalized = normalizeString(value).toLowerCase(); |
no outgoing calls
no test coverage detected