1891
}
1892
return acc;
1894
>
{} as Dictionary<string[]>
1895
>
)
1896
>
);
1897
>
// groups can now be reset
1898
>
this.#groups = {};
1899
>
1900
>
const arrayOptions: KeyOf<Options, string[]>[] = [
1901
>
'array',
1902
>
'boolean',
1903
>
'string',
1904
>
'skipValidation',
1905
>
'count',
1906
>
'normalize',
1907
>
'number',
1908
>
'hiddenOptions',
1909
>
];
1910
>
1911
>
const objectOptions: DictionaryKeyof<Options>[] = [
1912
>
'narg',
1913
>
'key',
1914
>
'alias',
1915
>
'default',
1916
>
'defaultDescription',
1917
>
'config',
1918
>
'choices',
1919
>
'demandedOptions',
1920
>
'demandedCommands',
1921
>
'deprecatedOptions',
1922
>
];
1923
>
1924
>
arrayOptions.forEach(k => {
1925
>
tmpOptions[k] = (this.#options[k] || []).filter(
1926
>
(k: string) => !localLookup[k]
1927
>
);
1928
>
});
1929
>
1930
>
objectOptions.forEach(<K extends DictionaryKeyof<Options>>(k: K) => {
1931
>
tmpOptions[k] = objFilter(
1932
>
this.#options[k],
1933
>
k => !localLookup[k as string]
1934
>
);
1935
>
});
1936
>
1937
>
tmpOptions.envPrefix = this.#options.envPrefix;
1938
>
this.#options = tmpOptions;
1939
>
1940
>
// if this is the first time being executed, create
1941
>
// instances of all our helpers -- otherwise just reset.
1942
>
this.#usage = this.#usage
1943
>
? this.#usage.reset(localLookup)
1944
>
: Usage(this, this.#shim);
1945
>
this.#validation = this.#validation
1946
>
? this.#validation.reset(localLookup)
1947
>
: Validation(this, this.#usage, this.#shim);
1948
>
this.#command = this.#command
1949
>
? this.#command.reset()
1950
>
: Command(
1951
>
this.#usage,
1952
>
this.#validation,
1953
>
this.#globalMiddleware,
1954
>
this.#shim
1955
>
);
1956
>
if (!this.#completion)
1957
>
this.#completion = Completion(
1958
>
this,
1959
>
this.#usage,
1960
>
this.#command,
1961
>
this.#shim
1962
>
);
1963
>
this.#globalMiddleware.reset();
1964
>
1965
>
this.#completionCommand = null;
1966
>
this.#output = '';
1967
>
this.#exitError = null;
1968
>
this.#hasOutput = false;
1969
>
this.parsed = false;
1970
>
1971
>
return this;
1972
>
}
1973
[kRebase](base: string, dir: string): string {
1975
>
}
1976
[kRunYargsParserAndExecuteCommands](
1977
args: string | string[] | null,