Merge branch 'master' into age-withdraw
This commit is contained in:
commit
dd4b96e1e6
@ -196,7 +196,7 @@ configCli
|
|||||||
res = config.getPath(args.get.section, args.get.option);
|
res = config.getPath(args.get.section, args.get.option);
|
||||||
}
|
}
|
||||||
if (res.isDefined()) {
|
if (res.isDefined()) {
|
||||||
console.log(res.value);
|
console.log(res.getValue());
|
||||||
} else {
|
} else {
|
||||||
console.warn("not found");
|
console.warn("not found");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
@ -82,7 +82,7 @@ export class ConfigValue<T> {
|
|||||||
private optionName: string,
|
private optionName: string,
|
||||||
private value: string | undefined,
|
private value: string | undefined,
|
||||||
private converter: (x: string) => T,
|
private converter: (x: string) => T,
|
||||||
) {}
|
) { }
|
||||||
|
|
||||||
required(): T {
|
required(): T {
|
||||||
if (this.value == undefined) {
|
if (this.value == undefined) {
|
||||||
@ -112,6 +112,10 @@ export class ConfigValue<T> {
|
|||||||
isDefined(): boolean {
|
isDefined(): boolean {
|
||||||
return this.value !== undefined;
|
return this.value !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getValue(): string | undefined {
|
||||||
|
return this.value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -245,7 +249,7 @@ function globMatch(pattern: string, str: string): boolean {
|
|||||||
/* Backtrack position in pattern */
|
/* Backtrack position in pattern */
|
||||||
let patBt = -1;
|
let patBt = -1;
|
||||||
|
|
||||||
for (;;) {
|
for (; ;) {
|
||||||
if (pattern[patPos] === "*") {
|
if (pattern[patPos] === "*") {
|
||||||
strBt = strPos;
|
strBt = strPos;
|
||||||
patBt = patPos++;
|
patBt = patPos++;
|
||||||
|
Loading…
Reference in New Issue
Block a user