querysub 0.678.0 → 0.679.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/config.ts +5 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "querysub",
3
- "version": "0.678.0",
3
+ "version": "0.679.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
package/src/config.ts CHANGED
@@ -32,8 +32,8 @@ let yargObj = parseArgsFactory()
32
32
  })
33
33
  .option("logbackblaze", { type: "boolean", desc: "Log all backblaze activity to disk." })
34
34
  .option("slowdown", { type: "number", desc: "Delay all input data values by this amount of time, pretending like we didn't even receive it until this time is up." })
35
- .option("network", { type: "array", desc: `The networks this node is on (pass multiple arguments to be on multiple, ex: --network test --network default). Authorities only satisfy paths on their networks ("default" if unset). Function calls are put on the first network in the list. If no FunctionRunner is on a call's network, the call will fail to run.` })
36
- .option("networkfile", { type: "string", desc: `The same as --network, except the networks are read from the given file (one per line). Supports "~/" for the home directory. If the file doesn't exist, the process exits with an error.` })
35
+ .option("network", { type: "array", desc: `The networks this node is on (pass multiple arguments to be on multiple, ex: --network test --network default, or comma separate them: --network test,default). Authorities only satisfy paths on their networks ("default" if unset). Function calls are put on the first network in the list. If no FunctionRunner is on a call's network, the call will fail to run.` })
36
+ .option("networkfile", { type: "string", desc: `The same as --network, except the networks are read from the given file (one per line, and commas separate as well). Supports "~/" for the home directory. If the file doesn't exist, the process exits with an error.` })
37
37
  .option("port", { type: "number", desc: "The storage port for `yarn storageserve`" })
38
38
  .argv
39
39
  ;
@@ -62,7 +62,7 @@ let networkFileNetworks = lazy((): string[] => {
62
62
  console.error(`--networkfile file not found: ${path}`);
63
63
  process.exit(1);
64
64
  }
65
- return fs.readFileSync(path, "utf8").split("\n").map(x => x.trim()).filter(x => x);
65
+ return fs.readFileSync(path, "utf8").split(/[\n,]/).map(x => x.trim()).filter(x => x);
66
66
  });
67
67
 
68
68
  /** The networks a function runner listens on, from the command line (--network / --networkfile). */
@@ -73,7 +73,8 @@ export function getNetworks(): string[] {
73
73
  } else if (!Array.isArray(networks)) {
74
74
  networks = [networks];
75
75
  }
76
- let result = networks.map(x => String(x));
76
+ // Comma separated is the same as repeating the flag, so a templated list of networks can be passed as one argument.
77
+ let result = networks.flatMap(x => String(x).split(",")).map(x => x.trim()).filter(x => x);
77
78
  if (isNode()) {
78
79
  result = [...result, ...networkFileNetworks()];
79
80
  }