Commit 5bcae244 authored by Alexandra's avatar Alexandra

new test files, Milestone 2 run like Milestone 1

parent 37816bdf
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="0.92">
<channel>
<title>RSS0.92 Example</title>
<link>http://www.oreilly.com/example/index.html</link>
<description>This is an example RSS0.91 feed</description>
<language>en-gb</language>
<copyright>Copyright 2002, Oreilly and Associates.</copyright>
<managingEditor>editor@oreilly.com</managingEditor>
<webMaster>webmaster@oreilly.com</webMaster>
<rating>5</rating>
<pubDate>03 Apr 02 1500 GMT</pubDate>
<lastBuildDate>03 Apr 02 1500 GMT</lastBuildDate>
<item>
<title>The First Item</title>
<link>http://www.oreilly.com/example/001.html</link>
<description>This is the first item.</description>
<source url="http://www.anothersite.com/index.xml">Another Site</source>
<enclosure url="http://www.oreilly.com/001.mp3" length="54321" type="audio/mpeg"/>
<category domain="http://www.dmoz.org">Business/Industries/Publishing/Publishers/Nonfiction/</category>
</item>
<item>
<title>The Second Item</title>
<link>http://www.oreilly.com/example/002.html</link>
<description>This is the second item.</description>
<source url="http://www.anothersite.com/index.xml">Another Site</source>
<enclosure url="http://www.oreilly.com/002.mp3" length="54321" type="audio/mpeg"/>
<category domain="http://www.dmoz.org">Business/Industries/Publishing/Publishers/Nonfiction/</category>
</item>
</channel>
</rss>
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="en-US">
<entry>
<author></author>
</entry>
</feed>
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
<title>Instant Article Test</title>
<link>https://localhost:8000</link>
<description>1, 2, 1, 2… check the mic!</description>
<language>en</language>
<pubDate>Fri, 13 May 2016 15:14:05 GMT</pubDate>
<dc:date>2016-05-13T15:14:05Z</dc:date>
<dc:language>en</dc:language>
<item>
<title>My first Instant Article</title>
<link>https://localhost:8000</link>
<description>Lorem ipsum</description>
<content:encoded>&lt;b&gt;Lorem&lt;/b&gt; ipsum</content:encoded>
<pubDate>Wed, 04 May 2016 06:53:45 GMT</pubDate>
<guid>https://localhost:8000</guid>
<dc:creator>tobi</dc:creator>
<dc:date>2016-05-04T06:53:45Z</dc:date>
</item>
</channel>
</rss>
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content" xmlns:dc="http://purl.org/dc/elements/1.1" xmlns:itunes="http://www.itunes.com/DTDs/Podcast-1.0.dtd" version="2.0">
<channel>
<title>Taverncast - Happy Hour in Your Head - Since 2005</title>
<itunes:author>Bryce Erwin, Bill Ticknor, Michelle O'Neill, Mike Monan, Aric Watson, Jennifer Albrecht, Lauren Hoban and Derek Chew</itunes:author>
<link>http://www.taverncast.com/</link>
<description>Order a beer, pull up a seat and join your friends at Taverncast for our patented un-scripted roundtable discussions, covering a wide range of topics with a unique wit and inviting style - all blended together, it's Happy Hour in Your Head!</description>
<itunes:subtitle>Beer - Talk - Fun. It's Happy Hour in Your Head!</itunes:subtitle>
<itunes:summary>Order a beer, pull up a seat and join your friends at Taverncast for our patented un-scripted roundtable discussions, covering a wide range of topics with a unique wit and inviting style - all blended together, it's Happy Hour in Your Head!</itunes:summary>
<language>en-us</language>
<copyright>Taverncast, 2015</copyright>
<managingEditor>taverncast@taverncast.com</managingEditor>
<pubDate>Wed, 03 Aug 2005 18:00:00 GMT</pubDate>
<generator>me mitts</generator>
<itunes:owner>
<itunes:name>Taverncast</itunes:name>
<itunes:email>taverncast@taverncast.com</itunes:email>
</itunes:owner>
<itunes:explicit>no</itunes:explicit>
<image>
<url>http://www.taverncast.com/itunes-logo.png</url>
<title>Taverncast - Happy Hour in Your Head - Since 2005</title>
<link>http://www.taverncast.com/</link>
<width>144</width>
<height>300</height>
</image>
<itunes:link rel="image" type="video/jpeg" href="http://www.taverncast.com/itunes-logo.png">Taverncast</itunes:link>
<itunes:image>href=http://www.taverncast.com/itunes-logo.png"&gt;</itunes:image>
<itunes:category text="Society &amp; Culture" />
<itunes:category text="Games &amp; Hobbies">
<itunes:category text="Hobbies" />
</itunes:category>
<item>
<title>Taverncast 62 - Temporal Anomaly</title>
<link>http://taverncast.com/</link>
<dc:creator>Taverncast: www.taverncast.com</dc:creator>
<content:encoded><![CDATA[Taverncast tosses around the age old topic: time travel! Where would you go? Why would you go? Also, Bryce has customer service issues, and Mike buys a dog.]]></content:encoded>
<comments>http://www.taverncast.com</comments>
<author>Taverncast</author>
<itunes:author>Taverncast</itunes:author>
<description>Taverncast tosses around the age old topic: time travel! Where would you go? Why would you go? Also, Bryce has customer service issues, and Mike buys a dog.</description>
<itunes:subtitle>Taverncast tosses around the age old topic: time travel! Where would you go? Why would you go? Also, Bryce has customer service issues, and Mike buys a dog.</itunes:subtitle>
<itunes:summary>Taverncast tosses around the age old topic: time travel! Where would you go? Why would you go? Also, Bryce has customer service issues, and Mike buys a dog.</itunes:summary>
<enclosure url="http://www.podtrac.com/pts/redirect.mp3?http://www.taverncast.com/shows/taverncast-62.mp3" length="47160424" type="audio/mpeg" />
<guid>http://taverncast.com/shows/taverncast-62.mp3</guid>
<pubDate>07 Nov 2015 12:00:00 EST</pubDate>
<category>Society &amp; Culture</category>
<itunes:explicit>no</itunes:explicit>
<itunes:duration>1:09:50</itunes:duration>
<itunes:keywords>Taverncast, beer, games, hobbies, gaming, computer, geek, party, movies, comics, pop-culture, weird, comedy, humor, funny, talk, nerd, news, politics, paranormal, conspiracy, morning show, stone brewing company, time travel, back to the future, past, future, present, timeline, temporal, travel, time, dog, doodle, poodle, apple, laptop, computer, arrogant, bastard, arrogant bastard</itunes:keywords>
</item>
</channel>
</rss>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xml:lang="en-US">
<entry>
<id>tag:github.com,2008:Repository/11167738/v3.9.0</id>
</entry>
</feed>
<head><title>Document Moved</title></head>
<body><h1>Object Moved</h1>This document may be found <a HREF="http://fishhawk2.marketwatch.com/rss/pf/">here</a></body>
\ No newline at end of file
file name,items,items in index,title found,content complete
./files/RSS/rss_100.xml,100,100,true,true
./files/RSS/atom-customfields.atom,15,15,true,true
./files/RSS/customfields.rss,15,15,true,true
./files/RSS/encoding.rss,40,40,true,true
./files/RSS/feedburner.atom,25,25,true,true
./files/RSS/giantbomb-podcast.rss,730,730,true,true
./files/RSS/heise.atom,15,15,true,true
./files/RSS/heraldsun.rss,2,2,true,true
./files/RSS/incomplete-fields.atom,1,0,true,true
./files/RSS/instant-article.rss,1,1,true,true
./files/RSS/itunes-category.rss,1,1,true,true
./files/RSS/missing-fields.atom,1,0,true,true
./files/RSS/rss_control.xml,100,100,true,true
./files/RSS/unrecognized.rss,bad formatting,Error: Feed not recognized as RSS 1 or 2.
\ No newline at end of file
file name,items,items in index,title found,content complete
./files/SITEMAP/sitemap_100.xml,100,86,true,true
......@@ -4,28 +4,58 @@ const readdir = util.promisify(fs.readdir);
const Rss_parser = require("rss-parser");
var rss_parser = new Rss_parser();
var xml_parser = require("xml2js").parseString;
const args = require("yargs")
.usage("Usage : Milestone2/run.js -only test -file only on this file -v")
.alias("f", "file")
.alias("o", "only")
.alias("v", "verbose")
.describe("file", "If you want to run the test on only one file" +
"(as opposed to all files in the directory), " +
"add this option and specify file location")
.describe("only", "If you only want to run one test, " +
"add this option and specify the test file name (rss/sitemap)")
.describe("verbose", "Print results to console, " +
"if not specified results will only be copied to result file")
.nargs("file", 1)
.nargs("only", 1)
.nargs("verbose", 0)
.argv;
var to_run_sitemap;
var to_run_rss = [];
var rss_stream;
var to_run_sitemap = [];
var sitemap_stream;
var only_script = args.only == null
? ""
: args.only;
var only_file = args.file == null
? ""
: args.file;
function run(script, files, stream, callback){
var childProcess = require("child_process");
if (files.length === 0) return;
if (files.length === 0){
callback();
return;
}
var invoked = false,
to_run = files.shift();
to_run = files.shift();
var new_process = childProcess.fork(script, ["-f", to_run]);
new_process.on("message", function (mes){
mes = mes.toString();
if (args.v) console.log(to_run + " : " + mes);
fs.readFile(to_run, (err, data) => {
if (to_run.includes("rss")){
if (to_run.includes("rss") || to_run.includes("atom")){
rss_parser.parseString(data, (err, result) => {
stream.write(to_run +","+ result.items.length +","+ mes + "\n");
if(err) stream.write(to_run + "," + "bad formatting" + "," + mes);
else stream.write(to_run +","+ result.items.length +","+ mes + "\n");
});
} else {
xml_parser(data, (err, result) => {
stream.write(to_run +","+ result.urlset.url.length.toString() +","+ mes + "\n");
if(err) stream.write(to_run + "," + "bad formatting" + "," + mes);
else stream.write(to_run +","+ result.urlset.url.length.toString() +","+ mes + "\n");
});
}
});
......@@ -38,29 +68,46 @@ function run(script, files, stream, callback){
callback(err);
});
new_process.on("exit", function () {
callback();
});
// new_process.on("exit", function () {
// callback();
// });
}
function run_sitemap(){
run("./unit_tests/test_sitemap.js", to_run_sitemap, sitemap_stream, function (){return;});
}
(async () => {
async function prep_rss(){
fs.truncateSync("./results/rss.csv");
fs.truncateSync("./results/sitemap.csv");
rss_stream = fs.createWriteStream("./results/rss.csv", {flags:"a"});
rss_stream.write("file name,items,items in index,title found,content complete\n");
var rss_files = await readdir("./files/RSS");
rss_files.forEach(file => {
if (file.includes(only_file)) to_run_rss.push("./files/RSS/" + file);
});
}
var rss_stream = fs.createWriteStream("./results/rss.csv", {flags:"a"});
async function prep_sitemap(){
fs.truncateSync("./results/sitemap.csv");
sitemap_stream = fs.createWriteStream("./results/sitemap.csv", {flags:"a"});
rss_stream.write("file name,items,items in index,title found,content complete\n");
sitemap_stream.write("file name,items,items in index,title found,content complete\n");
var rss_files = await readdir("./files/RSS");
var to_run_rss = rss_files.map(file => "./files/RSS/" + file);
var sitemap_files = await readdir("./files/SITEMAP");
to_run_sitemap = sitemap_files.map(file => "./files/SITEMAP/" + file);
sitemap_files.forEach(file => {
if (file.includes(only_file)) to_run_sitemap.push("./files/SITEMAP/" + file);
});
}
(async () => {
if (only_script.includes("rss")){
await prep_rss();
run("./unit_tests/test_rss.js", to_run_rss, rss_stream, function (){return;});
} else if (only_script.includes("sitemap")){
await prep_sitemap();
run_sitemap();
} else {
await prep_rss();
await prep_sitemap();
run("./unit_tests/test_rss.js", to_run_rss, rss_stream, run_sitemap);
}
run("./unit_tests/test_rss.js", to_run_rss, rss_stream, run_sitemap);
})();
const puppeteer = require("puppeteer");
const puppeteer = require("puppeteer");
const Server = require("ws").Server;
const args = require("yargs")
.usage("Usage : test_sitemap.js -file file_path")
......@@ -26,7 +26,7 @@ function init_server (){
(async () => {
init_server();
browser = await puppeteer.launch();
browser = await puppeteer.launch({headless : false});
var page = await browser.newPage();
await page.goto("https://softinst115787.host.vifib.net/public/unit_tests/test_sitemap.html");
const [fileChooser] = await Promise.all([
......@@ -34,4 +34,4 @@ function init_server (){
page.click("input#load")
]);
await fileChooser.accept([args.file]);
})();
\ No newline at end of file
})();
......@@ -18,6 +18,15 @@ export interface Limit {
The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
*/
readonly pendingCount: number;
/**
Discard pending promises that are waiting to run.
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
Note: This does not cancel promises that are already running.
*/
clearQueue(): void;
}
/**
......
......@@ -42,6 +42,11 @@ const pLimit = concurrency => {
},
pendingCount: {
get: () => queue.length
},
clearQueue: {
value: () => {
queue.length = 0;
}
}
});
......
{
"_from": "p-limit@^2.2.0",
"_id": "p-limit@2.2.2",
"_id": "p-limit@2.3.0",
"_inBundle": false,
"_integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==",
"_integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"_location": "/p-limit",
"_phantomChildren": {},
"_requested": {
......@@ -18,10 +18,10 @@
"_requiredBy": [
"/p-locate"
],
"_resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz",
"_shasum": "61279b67721f5287aa1c13a9a7fbbc48c9291b1e",
"_resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
"_shasum": "3dd33c647a214fdfffd835933eb086da0dc21db1",
"_spec": "p-limit@^2.2.0",
"_where": "C:\\Users\\thequ\\Documents\\Mynij\\Mynij-unit-tests\\node_modules\\p-locate",
"_where": "/home/alexandra/Documents/Mynij-unit-tests/node_modules/p-locate",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
......@@ -80,5 +80,5 @@
"scripts": {
"test": "xo && ava && tsd-check"
},
"version": "2.2.2"
"version": "2.3.0"
}
......@@ -66,6 +66,14 @@ The number of promises that are currently running.
The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
### limit.clearQueue()
Discard pending promises that are waiting to run.
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
Note: This does not cancel promises that are already running.
## FAQ
### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package?
......
......@@ -236,6 +236,7 @@ var Parser = function () {
var get = feedUrl.indexOf('https') === 0 ? https.get : http.get;
var urlParts = url.parse(feedUrl);
var headers = Object.assign({}, DEFAULT_HEADERS, this.options.headers);
var timeout = null;
var prom = new Promise(function (resolve, reject) {
var req = get({
headers: headers,
......@@ -264,10 +265,16 @@ var Parser = function () {
return _this2.parseString(xml).then(resolve, reject);
});
});
req.setTimeout(_this2.options.timeout, function () {
return reject(new Error("Request timed out after " + _this2.options.timeout + "ms"));
});
req.on('error', reject);
timeout = setTimeout(function () {
return reject(new Error("Request timed out after " + _this2.options.timeout + "ms"));
}, _this2.options.timeout);
}).then(function (data) {
clearTimeout(timeout);
return Promise.resolve(data);
}, function (e) {
clearTimeout(timeout);
return Promise.reject(e);
});
prom = utils.maybePromisify(callback, prom);
return prom;
......@@ -304,7 +311,7 @@ var Parser = function () {
}
if (entry.published && entry.published.length && entry.published[0].length) item.pubDate = new Date(entry.published[0]).toISOString();
if (!item.pubDate && entry.updated && entry.updated.length && entry.updated[0].length) item.pubDate = new Date(entry.updated[0]).toISOString();
if (entry.author && entry.author.length) item.author = entry.author[0].name[0];
if (entry.author && entry.author.length && entry.author[0].name && entry.author[0].name.length) item.author = entry.author[0].name[0];
if (entry.content && entry.content.length) {
item.content = utils.getContent(entry.content[0]);
item.contentSnippet = utils.getSnippet(item.content);
......@@ -428,13 +435,21 @@ var Parser = function () {
});
feed.itunes.categories = categories;
}
if (channel['itunes:keywords']) {
var keywords = channel['itunes:keywords'][0];
if (keywords && typeof keywords._ === 'string') {
keywords = keywords._;
if (channel['itunes:keywords'].length > 1) {
feed.itunes.keywords = channel['itunes:keywords'].map(function (keyword) {
return keyword.$.text;
});
} else {
var keywords = channel['itunes:keywords'][0];
if (keywords && typeof keywords._ === 'string') {
keywords = keywords._;
}
if (keywords) feed.itunes.keywords = keywords.split(',');
}
if (keywords) feed.itunes.keywords = keywords.split(",");
}
utils.copyFromXML(channel, feed.itunes, fields.podcastFeed);
items.forEach(function (item, index) {
var entry = feed.items[index];
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -261,13 +261,21 @@ class Parser {
});
feed.itunes.categories = categories;
}
if(channel['itunes:keywords']) {
let keywords=channel['itunes:keywords'][0];
if(keywords && typeof keywords._ === 'string'){
keywords=keywords._
if (channel['itunes:keywords']) {
if (channel['itunes:keywords'].length > 1) {
feed.itunes.keywords = channel['itunes:keywords'].map(
keyword => keyword.$.text
);
} else {
let keywords = channel['itunes:keywords'][0];
if (keywords && typeof keywords._ === 'string') {
keywords = keywords._;
}
if (keywords) feed.itunes.keywords = keywords.split(',');
}
if(keywords)feed.itunes.keywords = keywords.split(",");
}
utils.copyFromXML(channel, feed.itunes, fields.podcastFeed);
items.forEach((item, index) => {
let entry = feed.items[index];
......
{
"_from": "rss-parser@3.7.5",
"_id": "rss-parser@3.7.5",
"_from": "rss-parser@3.7.6",
"_id": "rss-parser@3.7.6",
"_inBundle": false,
"_integrity": "sha512-bUbAJfiuNyR/IGpYie6ro6x7X26QMWHxz1Sy9qkPyU/vYwbf3YdopQJIIELwdp3FCU4evcyetOD8bA8fgS+SqA==",
"_integrity": "sha512-wWWh3/pPLAPgWyfkCC9jB83jSBenU6VPMymfXiysi8wJxaN7KNkW4vU3Jm8jQxExAribFvXREy+RtaL3XQubeA==",
"_location": "/rss-parser",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "rss-parser@3.7.5",
"raw": "rss-parser@3.7.6",
"name": "rss-parser",
"escapedName": "rss-parser",
"rawSpec": "3.7.5",
"rawSpec": "3.7.6",
"saveSpec": null,
"fetchSpec": "3.7.5"
"fetchSpec": "3.7.6"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/rss-parser/-/rss-parser-3.7.5.tgz",
"_shasum": "f183148e81880f2e48166e09e9277b3c86de6de4",
"_spec": "rss-parser@3.7.5",
"_where": "C:\\Users\\thequ\\Documents\\Mynij\\Mynij-unit-tests\\Milestone1",
"_resolved": "https://registry.npmjs.org/rss-parser/-/rss-parser-3.7.6.tgz",
"_shasum": "d521507545a2c5f7b0f015846930c511f3a8dd93",
"_spec": "rss-parser@3.7.6",
"_where": "/home/alexandra/Documents/Mynij-unit-tests/Milestone2",
"author": {
"name": "Bobby Brennan"
},
......@@ -72,5 +72,5 @@
"test": "mocha --exit"
},
"types": "index.d.ts",
"version": "3.7.5"
"version": "3.7.6"
}
File mode changed from 100644 to 100755
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>SWR2 Impuls - Wissen aktuell</title>
<link>https://www.swr.de/swr2/programm/SWR2-Wissen-Impuls-Podcast,swr2-impuls-podcast-100.html</link>
<atom:link href="https://www.swr.de/~podcast/swr2/programm/SWR2-Wissen-Impuls-Podcast,swr2-impuls-podcast-100.xml" rel="self" type="application/rss+xml"/>
<description>Neues aus Wissenschaft, Medizin, Umwelt und Bildung. </description>
<googleplay:description>Neues aus Wissenschaft, Medizin, Umwelt und Bildung. </googleplay:description>
<language>de</language>
<copyright>Copyright © Südwestrundfunk</copyright>
<image>
<url>https://www.swr.de/swr2/programm/Podcastbild-SWR2-Impuls,1564741489275,swr2-impuls-podcast-104~_v-16x9@2dS_-6be50a9c75559ca1aaf1d0b25bae287afdcd877a.jpg</url>
<title>SWR2 Impuls - Wissen aktuell</title>
<link>https://www.swr.de/swr2/programm/SWR2-Wissen-Impuls-Podcast,swr2-impuls-podcast-100.html</link>
</image>
<pubDate>Wed, 9 Oct 2019 16:39:00 +0200</pubDate>
<itunes:subtitle>Neues aus Wissenschaft, Medizin, Umwelt und Bildung. Dazu Musik, die sich vom Mainstream abhebt. Montags bis freitags um 16:05. </itunes:subtitle>
<itunes:author>SWR</itunes:author>
<itunes:summary>Neues aus Wissenschaft, Medizin, Umwelt und Bildung. </itunes:summary>
<itunes:owner>
<itunes:name>Südwestrundfunk</itunes:name>
<itunes:email>podcast@swr.de</itunes:email>
</itunes:owner>
<googleplay:author>Südwestrundfunk</googleplay:author>
<itunes:image href="https://www.swr.de/swr2/programm/Podcastbild-SWR2-Impuls,1564741489275,swr2-impuls-podcast-104~_v-1x1@2dXL_-1f32c27c4978132dd0854e53b5ed30e10facc189.jpg"/>
<googleplay:image href="https://www.swr.de/swr2/programm/Podcastbild-SWR2-Impuls,1564741489275,swr2-impuls-podcast-104~_v-1x1@2dXL_-1f32c27c4978132dd0854e53b5ed30e10facc189.jpg"/>
<itunes:keywords text="Gesundheit und Mensch"/>
<itunes:keywords text="Wissenschaft und Forschung"/>
<itunes:keywords text="Wissen"/>
<itunes:keywords text="Wissenschaft"/>
<itunes:keywords text="Impuls"/>
<itunes:keywords text="Podcast"/>
<itunes:keywords text="Download"/>
<itunes:explicit>No</itunes:explicit>
<googleplay:explicit>No</googleplay:explicit>
<item>
<title>Ostafrika stellt sich auf die nächste Heuschreckenplage ein</title>
<link>https://www.swr.de/swr2/wissen/Hungersnot-Ostafrika-stellt-sich-auf-die-naechste-Heuschreckenplage-ein,ostafrika-stellt-sich-auf-naechste-heuschreckenplage-ein-100.html</link>
<description>Nach der jüngsten Heuschreckenplage droht Ostafrika neues Unheil. Es regnet mehr als sonst. Der feuchte Boden ist ein idealer Brutkasten für die nächste Generation Heuschrecken. Die ohnehin angespannte Ernährungslage könnte sich weiter verschlechtern.</description>
<googleplay:description>Nach der jüngsten Heuschreckenplage droht Ostafrika neues Unheil. Es regnet mehr als sonst. Der feuchte Boden ist ein idealer Brutkasten für die nächste Generation Heuschrecken. Die ohnehin angespannte Ernährungslage könnte sich weiter verschlechtern.</googleplay:description>
<category>Wissen,Heuschrecken,Heuschreckenschwärme,Heuschreckenplage,Ostafrika,Natur</category>
<pubDate>Tue, 10 Mar 2020 16:05:00 +0100</pubDate>
<guid isPermaLink="false">c88fbba9-c228-4724-bf41-8c193b72491c</guid>
<itunes:image href="https://www.swr.de/swr2/wissen/Heuschreckeninvasion-Hochland-von-Madagaskar-Afrika,1583836906080,swr2-impuls-heuschrecken-plage-afrika-100~_v-1x1@2dXL_-1f32c27c4978132dd0854e53b5ed30e10facc189.jpg"/>
<enclosure
length="4668354"
type="audio/mpeg" url="https://avdlswr-a.akamaihd.net/swr/swr2/wissen/impuls/beitraege/2020/03/ostafrika-droht-die-naechste-heuschreckenplage.m.mp3"/>
<itunes:duration>05:09</itunes:duration>
</item>
</channel>
</rss>
\ No newline at end of file
......@@ -4,4 +4,4 @@
{}
]
}
}
}
\ No newline at end of file
{
"feed": {
"items": [
{
"title": "Ostafrika stellt sich auf die nächste Heuschreckenplage ein",
"link": "https://www.swr.de/swr2/wissen/Hungersnot-Ostafrika-stellt-sich-auf-die-naechste-Heuschreckenplage-ein,ostafrika-stellt-sich-auf-naechste-heuschreckenplage-ein-100.html",
"pubDate": "Tue, 10 Mar 2020 16:05:00 +0100",
"enclosure": {
"length": "4668354",
"type": "audio/mpeg",
"url": "https://avdlswr-a.akamaihd.net/swr/swr2/wissen/impuls/beitraege/2020/03/ostafrika-droht-die-naechste-heuschreckenplage.m.mp3"
},
"content": "Nach der jüngsten Heuschreckenplage droht Ostafrika neues Unheil. Es regnet mehr als sonst. Der feuchte Boden ist ein idealer Brutkasten für die nächste Generation Heuschrecken. Die ohnehin angespannte Ernährungslage könnte sich weiter verschlechtern.",
"contentSnippet": "Nach der jüngsten Heuschreckenplage droht Ostafrika neues Unheil. Es regnet mehr als sonst. Der feuchte Boden ist ein idealer Brutkasten für die nächste Generation Heuschrecken. Die ohnehin angespannte Ernährungslage könnte sich weiter verschlechtern.",
"guid": "c88fbba9-c228-4724-bf41-8c193b72491c",
"categories": [
"Wissen,Heuschrecken,Heuschreckenschwärme,Heuschreckenplage,Ostafrika,Natur"
],
"isoDate": "2020-03-10T15:05:00.000Z",
"itunes": {
"duration": "05:09",
"image": "https://www.swr.de/swr2/wissen/Heuschreckeninvasion-Hochland-von-Madagaskar-Afrika,1583836906080,swr2-impuls-heuschrecken-plage-afrika-100~_v-1x1@2dXL_-1f32c27c4978132dd0854e53b5ed30e10facc189.jpg"
}
}
],
"feedUrl": "https://www.swr.de/~podcast/swr2/programm/SWR2-Wissen-Impuls-Podcast,swr2-impuls-podcast-100.xml",
"image": {
"link": "https://www.swr.de/swr2/programm/SWR2-Wissen-Impuls-Podcast,swr2-impuls-podcast-100.html",
"url": "https://www.swr.de/swr2/programm/Podcastbild-SWR2-Impuls,1564741489275,swr2-impuls-podcast-104~_v-16x9@2dS_-6be50a9c75559ca1aaf1d0b25bae287afdcd877a.jpg",
"title": "SWR2 Impuls - Wissen aktuell"
},
"title": "SWR2 Impuls - Wissen aktuell",
"description": "Neues aus Wissenschaft, Medizin, Umwelt und Bildung. ",
"pubDate": "Wed, 9 Oct 2019 16:39:00 +0200",
"link": "https://www.swr.de/swr2/programm/SWR2-Wissen-Impuls-Podcast,swr2-impuls-podcast-100.html",
"language": "de",
"copyright": "Copyright © Südwestrundfunk",
"itunes": {
"owner": {
"name": "Südwestrundfunk",
"email": "podcast@swr.de"
},
"image": "https://www.swr.de/swr2/programm/Podcastbild-SWR2-Impuls,1564741489275,swr2-impuls-podcast-104~_v-1x1@2dXL_-1f32c27c4978132dd0854e53b5ed30e10facc189.jpg",
"keywords": [
"Gesundheit und Mensch",
"Wissenschaft und Forschung",
"Wissen",
"Wissenschaft",
"Impuls",
"Podcast",
"Download"
],
"author": "SWR",
"subtitle": "Neues aus Wissenschaft, Medizin, Umwelt und Bildung. Dazu Musik, die sich vom Mainstream abhebt. Montags bis freitags um 16:05. ",
"summary": "Neues aus Wissenschaft, Medizin, Umwelt und Bildung. ",
"explicit": "No"
}
}
}
\ No newline at end of file
......@@ -261,6 +261,10 @@ describe('Parser', function() {
testParseForFile('itunes-keywords', 'rss', done);
});
it('should parse itunes keywords as array', function(done) {
testParseForFile('itunes-keywords-array', 'rss', done);
});
it('should parse giantbomb-podcast', function(done) {
testParseForFile('giantbomb-podcast', 'rss', done);
});
......
......@@ -30,6 +30,18 @@ For major (breaking) changes - version 3 and 2 see end of page.
| Version | Date | Comment |
| -------------- | -------------- | -------- |
| 4.23.1 | 2020-03-11 | `diskLayout()` optimized detection linux |
| 4.23.0 | 2020-03-08 | `versions()` added param to specify which program/lib versions to detect |
| 4.22.7 | 2020-03-08 | `diskLayout()` fixed linux |
| 4.22.6 | 2020-03-08 | `network()` fixed DHCP linux|
| 4.22.5 | 2020-03-04 | `graphics()` fixed vram macOS |
| 4.22.4 | 2020-03-01 | `versions()` added dotnet, typings fix |
| 4.22.3 | 2020-02-20 | `memLayout()` code cleanup |
| 4.22.2 | 2020-02-19 | `memLayout()` raspberry PI mem voltage fix |
| 4.22.1 | 2020-02-17 | `memLayout()` raspberry PI support |
| 4.22.0 | 2020-02-17 | `services()` added pids (windows) |
| 4.21.3 | 2020-02-16 | `versions()` fixed mysql version (macOS) |
| 4.21.2 | 2020-02-11 | `networkConnections()` fixed linux (debian) issue |
| 4.21.1 | 2020-01-31 | `networkGatewayDefault()` fixed windows 7 issue |
| 4.21.0 | 2020-01-27 | `npx` compatibility |
| 4.20.1 | 2020-01-26 | `battery()` code refactoring, cleanup, updated docs |
......
......@@ -27,9 +27,10 @@
[![Code Quality: Javascript][lgtm-badge]][lgtm-badge-url]
[![Total alerts][lgtm-alerts]][lgtm-alerts-url]
[![Caretaker][caretaker-image]][caretaker-url]
[![Sponsoring][sponsor-badge]][sponsor-url]
[![MIT license][license-img]][license-url]
This is amazing. Started as a small project just for myself, it now has > 9,000 lines of code, > 250 versions published, up to 1 mio downloads per month, > 4 mio downloads overall. Thank you to all who contributed to this project!
This is amazing. Started as a small project just for myself, it now has > 9,000 lines of code, > 300 versions published, up to 1 mio downloads per month, > 6 mio downloads overall. Thank you to all who contributed to this project!
## New Version 4.0
......@@ -84,13 +85,13 @@ si.cpu()
(last 7 major and minor version releases)
- Version 4.23.0: `versions()` added param to specify which program/lib versions to detect
- Version 4.22.0: `services()` added pids (windows)
- Version 4.21.0: added npx copmpatibility
- Version 4.20.0: `battery()` added designcapacity, voltage, unit
- Version 4.19.0: `osInfo()` added uefi (OS uses UEFI during startup)
- Version 4.18.0: `networkInterfaces()` added dhcp for mac os, added dhcp linux fallback
- Version 4.17.0: `networkInterfaces()` added dhcp, dnsSuffix, ieee8021xAuth, ieee8021xState
- Version 4.16.0: `networkGatewayDefault()` added
- Version 4.15.0: `cpu()` added governor (linux)
- ...
You can find all changes here: [detailed changelog][changelog-url]
......@@ -295,7 +296,7 @@ I also created a nice little command line tool called [mmon][mmon-github-url] (
| | uefi | X | X | X | X | | OS started via UEFI |
| si.uuid(cb) | {...} | X | X | X | X | X | object of several UUIDs |
| | os | X | X | X | X | | os specific UUID |
| si.versions(cb) | {...} | X | X | X | X | X | version information (kernel, ssl, node, ...) |
| si.versions(apps, cb) | {...} | X | X | X | X | X | version information (kernel, ssl, node, ...)<br />apps param is optional for detecting<br />only specific apps/libs<br />(string, comma separated) |
| si.shell(cb) | : string | X | X | X | | | standard shell |
| si.users(cb) | [{...}] | X | X | X | X | X | array of users online |
| | [0].user | X | X | X | X | X | user name |
......@@ -354,7 +355,7 @@ I also created a nice little command line tool called [mmon][mmon-github-url] (
| | [0].name | X | X | X | X | | name of service |
| | [0].running | X | X | X | X | | true / false |
| | [0].startmode | | | | X | | manual, automatic, ... |
| | [0].pids | X | X | X | | | pids |
| | [0].pids | X | X | X | X | | pids |
| | [0].pcpu | X | X | X | | | process % CPU |
| | [0].pmem | X | X | X | | | process % MEM |
......@@ -850,6 +851,9 @@ All other trademarks are the property of their respective owners.
[lgtm-alerts]: https://img.shields.io/lgtm/alerts/g/sebhildebrandt/systeminformation.svg?style=flat-square
[lgtm-alerts-url]: https://lgtm.com/projects/g/sebhildebrandt/systeminformation/alerts
[sponsor-badge]: https://img.shields.io/badge/-Buy%20me%20a%20coffee-blue?style=flat-square
[sponsor-url]: https://www.buymeacoffee.com/systeminfo
[license-url]: https://github.com/sebhildebrandt/systeminformation/blob/master/LICENSE
[license-img]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
[npmjs-license]: https://img.shields.io/npm/l/systeminformation.svg?style=flat-square
......
File mode changed from 100644 to 100755
......@@ -722,11 +722,13 @@ function diskLayout(callback) {
];
let result = '';
model = model.toUpperCase();
diskManufacturers.forEach((manufacturer) => {
const re = RegExp(manufacturer.pattern);
if (re.test(model)) { result = manufacturer.manufacturer; }
});
if (model) {
model = model.toUpperCase();
diskManufacturers.forEach((manufacturer) => {
const re = RegExp(manufacturer.pattern);
if (re.test(model)) { result = manufacturer.manufacturer; }
});
}
return result;
}
......@@ -745,21 +747,21 @@ function diskLayout(callback) {
try {
const outJSON = JSON.parse(out);
if (outJSON && {}.hasOwnProperty.call(outJSON, 'blockdevices')) {
devices = outJSON.blockdevices.filter(item => { return item.group === 'disk' && item.size > 0 && item.model !== null; });
devices = outJSON.blockdevices.filter(item => { return (item.group === 'disk' || item.type === 'disk') && item.size > 0 && (item.model !== null || (item.mountpoint === null && item.label === null && item.fstype === null && item.parttype === null)); });
}
} catch (e) {
// fallback to older version of lsblk
const out2 = execSync('export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL').toString();
let lines = blkStdoutToObject(out2).split('\n');
const data = parseBlk(lines);
devices = data.filter(item => { return item.group === 'disk' && item.size > 0 && item.model !== null && item.model !== ''; });
devices = data.filter(item => { return (item.group === 'disk' || item.type === 'disk') && item.size > 0 && ((item.model !== null && item.model !== '') || (item.mountpoint === '' && item.label === '' && item.fstype === '')); });
}
devices.forEach((device) => {
let mediumType = '';
const BSDName = '/dev/' + device.name;
const logical = device.name;
try {
mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational').toString().split('\n')[0];
mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational 2>/dev/null').toString().split('\n')[0];
} catch (e) {
util.noop();
}
......@@ -793,8 +795,6 @@ function diskLayout(callback) {
util.noop();
}
}
// lshw sometimes returns empty results, try lsblk
// check S.M.A.R.T. status
if (cmd) {
cmd = cmd + 'printf "\n"';
......
......@@ -133,10 +133,16 @@ function graphics(callback) {
if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('vendor') !== -1) currentController.vendor = parts[1].split('(')[0].trim();
if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('vram(total)') !== -1) {
currentController.vram = parseInt(parts[1]); // in MB
if (parts[1].toLowerCase().indexOf('gb') !== -1) {
currentController.vram = currentController.vram * 1024;
}
currentController.vramDynamic = false;
}
if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('vram(dynamic,max)') !== -1) {
currentController.vram = parseInt(parts[1]); // in MB
if (parts[1].toLowerCase().indexOf('gb') !== -1) {
currentController.vram = currentController.vram * 1024;
}
currentController.vramDynamic = true;
}
}
......
......@@ -83,9 +83,9 @@ export namespace Systeminformation {
}
interface CpuCurrentSpeedData {
min: string;
max: string;
avg: string;
min: number;
max: number;
avg: number;
cores: number[];
}
......@@ -214,35 +214,36 @@ export namespace Systeminformation {
}
interface VersionData {
kernel: string;
openssl: string;
systemOpenssl: string;
systemOpensslLib: string;
node: string;
v8: string;
npm: string;
yarn: string;
pm2: string;
gulp: string;
grunt: string;
git: string;
tsc: string;
mysql: string;
redis: string;
mongodb: string;
nginx: string;
php: string;
docker: string;
postfix: string;
postgresql: string;
perl: string;
python: string;
python3: string;
pip: string;
pip3: string;
java: string;
gcc: string;
virtualbox: string;
kernel?: string;
openssl?: string;
systemOpenssl?: string;
systemOpensslLib?: string;
node?: string;
v8?: string;
npm?: string;
yarn?: string;
pm2?: string;
gulp?: string;
grunt?: string;
git?: string;
tsc?: string;
mysql?: string;
redis?: string;
mongodb?: string;
nginx?: string;
php?: string;
docker?: string;
postfix?: string;
postgresql?: string;
perl?: string;
python?: string;
python3?: string;
pip?: string;
pip3?: string;
java?: string;
gcc?: string;
virtualbox?: string;
dotnet?: string;
}
interface UserData {
......@@ -625,7 +626,7 @@ export function chassis(cb?: (data: Systeminformation.ChassisData) => any): Prom
export function time(): Systeminformation.TimeData;
export function osInfo(cb?: (data: Systeminformation.OsData) => any): Promise<Systeminformation.OsData>;
export function versions(cb?: (data: Systeminformation.VersionData) => any): Promise<Systeminformation.VersionData>;
export function versions(apps?: string, cb?: (data: Systeminformation.VersionData) => any): Promise<Systeminformation.VersionData>;
export function shell(cb?: (data: string) => any): Promise<string>;
export function uuid(cb?: (data: Systeminformation.UuidData) => any): Promise<Systeminformation.UuidData>;
......
......@@ -15,6 +15,7 @@
const os = require('os');
const exec = require('child_process').exec;
const execSync = require('child_process').execSync;
const util = require('./util');
let _platform = process.platform;
......@@ -314,6 +315,62 @@ function memLayout(callback) {
}
});
}
if (!result.length) {
result.push({
size: os.totalmem(),
bank: '',
type: '',
clockSpeed: 0,
formFactor: '',
partNum: '',
serialNum: '',
voltageConfigured: -1,
voltageMin: -1,
voltageMax: -1,
});
// Try Raspberry PI
try {
let stdout = execSync('cat /proc/cpuinfo 2>/dev/null');
let lines = stdout.toString().split('\n');
let model = util.getValue(lines, 'hardware', ':', true).toUpperCase();
let version = util.getValue(lines, 'revision', ':', true).toLowerCase();
if (model === 'BCM2835' || model === 'BCM2708' || model === 'BCM2709' || model === 'BCM2835' || model === 'BCM2837') {
const clockSpeed = {
'0': 400,
'1': 450,
'2': 450,
'3': 3200
};
result[0].clockSpeed = version && version[2] && clockSpeed[version[2]] || 400;
result[0].clockSpeed = version && version[4] && version[4] === 'd' ? '500' : result[0].clockSpeed;
result[0].type = 'LPDDR2';
result[0].type = version && version[2] && version[2] === '3' ? 'LPDDR4' : result[0].type;
result[0].formFactor = 'SoC';
stdout = execSync('vcgencmd get_config sdram_freq 2>/dev/null');
lines = stdout.toString().split('\n');
let freq = parseInt(util.getValue(lines, 'sdram_freq', '=', true), 10) || 0;
if (freq) {
result.clockSpeed = freq;
}
stdout = execSync('vcgencmd measure_volts sdram_p 2>/dev/null');
lines = stdout.toString().split('\n');
let voltage = parseFloat(util.getValue(lines, 'volt', '=', true)) || 0;
if (voltage) {
result[0].voltageConfigured = voltage;
result[0].voltageMin = voltage;
result[0].voltageMax = voltage;
}
}
} catch (e) {
util.noop();
}
}
if (callback) { callback(result); }
resolve(result);
});
......
......@@ -489,6 +489,26 @@ function getLinuxIfaceConnectionName(interfaceName) {
}
}
function checkLinuxDCHPInterfaces(file) {
let result = [];
let cmd = `cat ${file} 2> /dev/null | grep 'iface\\|source'`;
const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\n');
lines.forEach(line => {
const parts = line.replace(/\s+/g, ' ').trim().split(' ');
if (parts.length >= 4) {
if (line.toLowerCase().indexOf(' inet ') >= 0 && line.toLowerCase().indexOf('dhcp') >= 0) {
result.push(parts[1]);
}
}
if (line.toLowerCase().includes('source')) {
let file = line.split(' ')[1];
result = result.concat(checkLinuxDCHPInterfaces(file));
}
});
return result;
}
function getLinuxDHCPNics() {
// alternate methods getting interfaces using DHCP
let cmd = 'ip a 2> /dev/null';
......@@ -501,16 +521,7 @@ function getLinuxDHCPNics() {
util.noop();
}
try {
cmd = 'cat /etc/network/interfaces 2> /dev/null | grep iface';
const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\n');
lines.forEach(line => {
const parts = line.replace(/\s+/g, ' ').trim().split(' ');
if (parts.length >=4) {
if (line.toLowerCase().indexOf(' inet ') >= 0 && line.toLowerCase().indexOf('dhcp') >= 0) {
result.push(parts[1]);
}
}
});
result = checkLinuxDCHPInterfaces('/etc/network/interfaces');
} catch (e) {
util.noop();
}
......@@ -549,13 +560,13 @@ function getLinuxIfaceDHCPstatus(iface, connectionName, DHCPNics) {
let dhcStatus = resultFormat.split(' ').slice(1).toString();
switch (dhcStatus) {
case 'auto':
result = true;
break;
case 'auto':
result = true;
break;
default:
result = false;
break;
default:
result = false;
break;
}
return result;
} catch (e) {
......@@ -1132,8 +1143,8 @@ function networkConnections(callback) {
let cmd = 'export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';
if (_freebsd || _openbsd || _netbsd) cmd = 'export LC_ALL=C; netstat -na | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';
exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {
if (!error) {
let lines = stdout.toString().split('\n');
let lines = stdout.toString().split('\n');
if (!error && (lines.length > 1 || lines[0] != '')) {
lines.forEach(function (line) {
line = line.replace(/ +/g, ' ').split(' ');
if (line.length >= 7) {
......@@ -1423,20 +1434,20 @@ function networkGatewayDefault(callback) {
callback(result);
}
resolve(result);
// } else {
// exec('ipconfig', util.execOptsWin, function (error, stdout) {
// let lines = stdout.toString().split('\r\n');
// lines.forEach(function (line) {
// line = line.trim().replace(/\. /g, '');
// line = line.trim().replace(/ +/g, '');
// const parts = line.split(':');
// if ((parts[0].toLowerCase().startsWith('standardgate') || parts[0].toLowerCase().indexOf('gateway') > -1 || parts[0].toLowerCase().indexOf('enlace') > -1) && parts[1]) {
// result = parts[1];
// }
// });
// if (callback) { callback(result); }
// resolve(result);
// });
// } else {
// exec('ipconfig', util.execOptsWin, function (error, stdout) {
// let lines = stdout.toString().split('\r\n');
// lines.forEach(function (line) {
// line = line.trim().replace(/\. /g, '');
// line = line.trim().replace(/ +/g, '');
// const parts = line.split(':');
// if ((parts[0].toLowerCase().startsWith('standardgate') || parts[0].toLowerCase().indexOf('gateway') > -1 || parts[0].toLowerCase().indexOf('enlace') > -1) && parts[1]) {
// result = parts[1];
// }
// });
// if (callback) { callback(result); }
// resolve(result);
// });
}
});
} else {
......
......@@ -135,7 +135,10 @@ function services(srv, callback) {
let singleSrv = allSrv.filter(item => { return item.name === srv; });
const pids = [];
for (const p of ps) {
pids.push(p.trim().split(' ')[2]);
const pid = p.trim().split(' ')[2];
if (pid) {
pids.push(parseInt(pid, 10));
}
}
result.push({
name: srv,
......@@ -257,11 +260,13 @@ function services(srv, callback) {
let srvName = util.getValue(lines, 'Name', '=', true).toLowerCase();
let started = util.getValue(lines, 'Started', '=', true);
let startMode = util.getValue(lines, 'StartMode', '=', true);
let pid = util.getValue(lines, 'ProcessId', '=', true);
if (srv === '*' || srvs.indexOf(srvName) >= 0) {
result.push({
name: srvName,
running: (started === 'TRUE'),
startmode: startMode,
pids: [ pid],
pcpu: 0,
pmem: 0
});
......@@ -278,6 +283,7 @@ function services(srv, callback) {
name: srvName,
running: false,
startmode: '',
pids: [],
pcpu: 0,
pmem: 0
});
......
......@@ -100,6 +100,10 @@ function system(callback) {
if (result.model === 'BCM2835' || result.model === 'BCM2708' || result.model === 'BCM2709' || result.model === 'BCM2835' || result.model === 'BCM2837') {
// Pi 4
if (['c03112'].indexOf(result.version) >= 0) {
result.model = result.model + ' - Pi 4 Model B';
result.version = result.version + ' - Rev. 1.2';
}
if (['a03111', 'b03111', 'c03111'].indexOf(result.version) >= 0) {
result.model = result.model + ' - Pi 4 Model B';
result.version = result.version + ' - Rev. 1.1';
......
{
"_from": "systeminformation@4.21.1",
"_id": "systeminformation@4.21.1",
"_from": "systeminformation@4.23.1",
"_id": "systeminformation@4.23.1",
"_inBundle": false,
"_integrity": "sha512-IQMy+ieSThY+MfLZaCdQsGCteMah4nhsDQcnT9DhocoJnhMKVUqDY025j1i+MSm7qdUCMXS5oV7dvttr+pSodw==",
"_integrity": "sha512-gtqfvz5jUIMqWn0kkdkV4G8uiLmJckQ+z6aKy1uyE0OPU/6tStubahtZDiF0ajSRVJht+Vd4pX5DDwQLhAapww==",
"_location": "/systeminformation",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "systeminformation@4.21.1",
"raw": "systeminformation@4.23.1",
"name": "systeminformation",
"escapedName": "systeminformation",
"rawSpec": "4.21.1",
"rawSpec": "4.23.1",
"saveSpec": null,
"fetchSpec": "4.21.1"
"fetchSpec": "4.23.1"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-4.21.1.tgz",
"_shasum": "8394684676c9ca1da59d9f92458b166d9cd52cd6",
"_spec": "systeminformation@4.21.1",
"_where": "C:\\Users\\thequ\\Documents\\Mynij\\Mynij-unit-tests\\Milestone1",
"_resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-4.23.1.tgz",
"_shasum": "03dcc16570adfa1e0b6ceb871aad8f34c9ae8014",
"_spec": "systeminformation@4.23.1",
"_where": "/home/alexandra/Documents/Mynij-unit-tests/Milestone2",
"author": {
"name": "Sebastian Hildebrandt",
"email": "hildebrandt@plus-innovations.com",
"url": "https://plus-innovations.com"
},
"bin": {
"systeminformation": "./lib/cli.js"
"systeminformation": "lib/cli.js"
},
"bugs": {
"url": "https://github.com/sebhildebrandt/systeminformation/issues"
......@@ -56,6 +56,10 @@
"files": [
"lib/"
],
"funding": {
"type": "Buy me a coffee",
"url": "https://www.buymeacoffee.com/systeminfo"
},
"homepage": "https://github.com/sebhildebrandt/systeminformation",
"keywords": [
"system information",
......@@ -149,5 +153,5 @@
"watch": "tsc -w"
},
"types": "./lib/index.d.ts",
"version": "4.21.1"
"version": "4.23.1"
}
......@@ -2,6 +2,76 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [18.1.2](https://www.github.com/yargs/yargs-parser/compare/v18.1.1...v18.1.2) (2020-03-26)
### Bug Fixes
* **array, nargs:** support -o=--value and --option=--value format ([#262](https://www.github.com/yargs/yargs-parser/issues/262)) ([41d3f81](https://www.github.com/yargs/yargs-parser/commit/41d3f8139e116706b28de9b0de3433feb08d2f13))
### [18.1.1](https://www.github.com/yargs/yargs-parser/compare/v18.1.0...v18.1.1) (2020-03-16)
### Bug Fixes
* \_\_proto\_\_ will now be replaced with \_\_\_proto\_\_\_ in parse ([#258](https://www.github.com/yargs/yargs-parser/issues/258)), patching a potential
prototype pollution vulnerability. This was reported by the Snyk Security Research Team.([63810ca](https://www.github.com/yargs/yargs-parser/commit/63810ca1ae1a24b08293a4d971e70e058c7a41e2))
## [18.1.0](https://www.github.com/yargs/yargs-parser/compare/v18.0.0...v18.1.0) (2020-03-07)
### Features
* introduce single-digit boolean aliases ([#255](https://www.github.com/yargs/yargs-parser/issues/255)) ([9c60265](https://www.github.com/yargs/yargs-parser/commit/9c60265fd7a03cb98e6df3e32c8c5e7508d9f56f))
## [18.0.0](https://www.github.com/yargs/yargs-parser/compare/v17.1.0...v18.0.0) (2020-03-02)
### ⚠ BREAKING CHANGES
* the narg count is now enforced when parsing arrays.
### Features
* NaN can now be provided as a value for nargs, indicating "at least" one value is expected for array ([#251](https://www.github.com/yargs/yargs-parser/issues/251)) ([9db4be8](https://www.github.com/yargs/yargs-parser/commit/9db4be81417a2c7097128db34d86fe70ef4af70c))
## [17.1.0](https://www.github.com/yargs/yargs-parser/compare/v17.0.1...v17.1.0) (2020-03-01)
### Features
* introduce greedy-arrays config, for specifying whether arrays consume multiple positionals ([#249](https://www.github.com/yargs/yargs-parser/issues/249)) ([60e880a](https://www.github.com/yargs/yargs-parser/commit/60e880a837046314d89fa4725f923837fd33a9eb))
### [17.0.1](https://www.github.com/yargs/yargs-parser/compare/v17.0.0...v17.0.1) (2020-02-29)
### Bug Fixes
* normalized keys were not enumerable ([#247](https://www.github.com/yargs/yargs-parser/issues/247)) ([57119f9](https://www.github.com/yargs/yargs-parser/commit/57119f9f17cf27499bd95e61c2f72d18314f11ba))
## [17.0.0](https://www.github.com/yargs/yargs-parser/compare/v16.1.0...v17.0.0) (2020-02-10)
### ⚠ BREAKING CHANGES
* this reverts parsing behavior of booleans to that of yargs@14
* objects used during parsing are now created with a null
prototype. There may be some scenarios where this change in behavior
leaks externally.
### Features
* boolean arguments will not be collected into an implicit array ([#236](https://www.github.com/yargs/yargs-parser/issues/236)) ([34c4e19](https://www.github.com/yargs/yargs-parser/commit/34c4e19bae4e7af63e3cb6fa654a97ed476e5eb5))
* introduce nargs-eats-options config option ([#246](https://www.github.com/yargs/yargs-parser/issues/246)) ([d50822a](https://www.github.com/yargs/yargs-parser/commit/d50822ac10e1b05f2e9643671ca131ac251b6732))
### Bug Fixes
* address bugs with "uknown-options-as-args" ([bc023e3](https://www.github.com/yargs/yargs-parser/commit/bc023e3b13e20a118353f9507d1c999bf388a346))
* array should take precedence over nargs, but enforce nargs ([#243](https://www.github.com/yargs/yargs-parser/issues/243)) ([4cbc188](https://www.github.com/yargs/yargs-parser/commit/4cbc188b7abb2249529a19c090338debdad2fe6c))
* support keys that collide with object prototypes ([#234](https://www.github.com/yargs/yargs-parser/issues/234)) ([1587b6d](https://www.github.com/yargs/yargs-parser/commit/1587b6d91db853a9109f1be6b209077993fee4de))
* unknown options terminated with digits now handled by unknown-options-as-args ([#238](https://www.github.com/yargs/yargs-parser/issues/238)) ([d36cdfa](https://www.github.com/yargs/yargs-parser/commit/d36cdfa854254d7c7e0fe1d583818332ac46c2a5))
## [16.1.0](https://www.github.com/yargs/yargs-parser/compare/v16.0.0...v16.1.0) (2019-11-01)
......
# yargs-parser
[![Build Status](https://travis-ci.org/yargs/yargs-parser.svg)](https://travis-ci.org/yargs/yargs-parser)
[![Coverage Status](https://coveralls.io/repos/yargs/yargs-parser/badge.svg?branch=)](https://coveralls.io/r/yargs/yargs-parser?branch=master)
[![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser)
[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
......@@ -265,6 +264,34 @@ node example.js -x 1 2 -x 3 4
{ _: [], x: [[1, 2], [3, 4]] }
```
### greedy arrays
* default: `true`
* key: `greedy-arrays`
Should arrays consume more than one positional argument following their flag.
```sh
node example --arr 1 2
{ _[], arr: [1, 2] }
```
_if disabled:_
```sh
node example --arr 1 2
{ _[2], arr: [1] }
```
**Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.**
### nargs eats options
* default: `false`
* key: `nargs-eats-options`
Should nargs consume dash options as well as positional arguments.
### negation prefix
* default: `no-`
......
......@@ -6,13 +6,13 @@ module.exports = function (argString) {
argString = argString.trim()
var i = 0
var prevC = null
var c = null
var opening = null
var args = []
let i = 0
let prevC = null
let c = null
let opening = null
const args = []
for (var ii = 0; ii < argString.length; ii++) {
for (let ii = 0; ii < argString.length; ii++) {
prevC = c
c = argString.charAt(ii)
......
{
"_from": "yargs-parser@^16.1.0",
"_id": "yargs-parser@16.1.0",
"_from": "yargs-parser@^18.1.1",
"_id": "yargs-parser@18.1.2",
"_inBundle": false,
"_integrity": "sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==",
"_location": "/yargs/yargs-parser",
"_integrity": "sha512-hlIPNR3IzC1YuL1c2UwwDKpXlNFBqD1Fswwh1khz5+d8Cq/8yc/Mn0i+rQXduu8hcrFKvO7Eryk+09NecTQAAQ==",
"_location": "/yargs-parser",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "yargs-parser@^16.1.0",
"raw": "yargs-parser@^18.1.1",
"name": "yargs-parser",
"escapedName": "yargs-parser",
"rawSpec": "^16.1.0",
"rawSpec": "^18.1.1",
"saveSpec": null,
"fetchSpec": "^16.1.0"
"fetchSpec": "^18.1.1"
},
"_requiredBy": [
"/yargs"
],
"_resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-16.1.0.tgz",
"_shasum": "73747d53ae187e7b8dbe333f95714c76ea00ecf1",
"_spec": "yargs-parser@^16.1.0",
"_where": "C:\\Users\\thequ\\Documents\\Mynij\\Mynij-unit-tests\\node_modules\\yargs",
"_resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.2.tgz",
"_shasum": "2f482bea2136dbde0861683abea7756d30b504f1",
"_spec": "yargs-parser@^18.1.1",
"_where": "/home/alexandra/Documents/Mynij-unit-tests/node_modules/yargs",
"author": {
"name": "Ben Coe",
"email": "ben@npmjs.com"
......@@ -37,14 +37,12 @@
"deprecated": false,
"description": "the mighty option parser used by yargs",
"devDependencies": {
"c8": "^6.0.0",
"c8": "^7.0.1",
"chai": "^4.2.0",
"coveralls": "^3.0.2",
"mocha": "^5.2.0",
"standard": "^12.0.1",
"standard-version": "^6.0.0"
"mocha": "^7.0.0",
"standard": "^14.3.1"
},
"engine": {
"engines": {
"node": ">=6"
},
"files": [
......@@ -67,13 +65,14 @@
"main": "index.js",
"name": "yargs-parser",
"repository": {
"url": "git+ssh://git@github.com/yargs/yargs-parser.git"
"type": "git",
"url": "git+https://github.com/yargs/yargs-parser.git"
},
"scripts": {
"coverage": "c8 report --reporter=text-lcov | coveralls",
"coverage": "c8 report --check-coverage check-coverage --lines=100 --branches=97 --statements=100",
"fix": "standard --fix",
"posttest": "standard",
"release": "standard-version",
"test": "c8 --reporter=text --reporter=html mocha test/*.js"
},
"version": "16.1.0"
"version": "18.1.2"
}
This diff is collapsed.
......@@ -9,9 +9,9 @@
<br>
[![Build Status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]
[![NPM version][npm-image]][npm-url]
[![js-standard-style][standard-image]][standard-url]
[![Coverage][coverage-image]][coverage-url]
[![Conventional Commits][conventional-commits-image]][conventional-commits-url]
[![Slack][slack-image]][slack-url]
......@@ -127,8 +127,6 @@ Having problems? want to contribute? join our [community slack](http://devtoolsc
[travis-url]: https://travis-ci.org/yargs/yargs
[travis-image]: https://img.shields.io/travis/yargs/yargs/master.svg
[coveralls-url]: https://coveralls.io/github/yargs/yargs
[coveralls-image]: https://img.shields.io/coveralls/yargs/yargs.svg
[npm-url]: https://www.npmjs.com/package/yargs
[npm-image]: https://img.shields.io/npm/v/yargs.svg
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
......@@ -138,3 +136,5 @@ Having problems? want to contribute? join our [community slack](http://devtoolsc
[slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg
[slack-url]: http://devtoolscommunity.herokuapp.com
[type-definitions]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs
[coverage-image]: https://img.shields.io/badge/dynamic/json?color=brightgreen&label=coverage&query=branches&suffix=%25&url=https%3A%2F%2Fraw.githubusercontent.com%2Fyargs%2Fyargs%2Fmaster%2F.nycrc&cacheSeconds=3600
[coverage-url]: https://github.com/yargs/yargs/blob/master/.nycrc
\ No newline at end of file
......@@ -3,8 +3,9 @@
// without running as a singleton do:
// require('yargs/yargs')(process.argv.slice(2))
const yargs = require('./yargs')
const processArgv = require('./lib/process-argv')
Argv(process.argv.slice(2))
Argv(processArgv.getProcessArgvWithoutBin())
module.exports = Argv
......
......@@ -20,7 +20,7 @@ function mergeDeep (config1, config2) {
const target = {}
const isObject = obj => obj && typeof obj === 'object' && !Array.isArray(obj)
Object.assign(target, config1)
for (let key of Object.keys(config2)) {
for (const key of Object.keys(config2)) {
if (isObject(config2[key]) && isObject(target[key])) {
target[key] = mergeDeep(config1[key], config2[key])
} else {
......
......@@ -256,6 +256,9 @@ module.exports = function command (yargs, usage, validation, globalMiddleware) {
// fail's throwing would cause an unhandled rejection.
}
})
.then(() => {
yargs.getUsageInstance().clearCachedHelpMessage()
})
} else {
if (handlerFinishCommand) {
handlerFinishCommand(handlerResult)
......@@ -440,16 +443,16 @@ module.exports = function command (yargs, usage, validation, globalMiddleware) {
// the state of commands such that
// we can apply .parse() multiple times
// with the same yargs instance.
let frozens = []
const frozens = []
self.freeze = () => {
let frozen = {}
const frozen = {}
frozens.push(frozen)
frozen.handlers = handlers
frozen.aliasMap = aliasMap
frozen.defaultCommand = defaultCommand
}
self.unfreeze = () => {
let frozen = frozens.pop()
const frozen = frozens.pop()
handlers = frozen.handlers
aliasMap = frozen.aliasMap
defaultCommand = frozen.defaultCommand
......
......@@ -76,21 +76,30 @@ module.exports = function completion (yargs, usage, command) {
if (current.match(/^-/) || (current === '' && completions.length === 0)) {
const descs = usage.getDescriptions()
Object.keys(yargs.getOptions().key).forEach((key) => {
const options = yargs.getOptions()
Object.keys(options.key).forEach((key) => {
const negable = !!options.configuration['boolean-negation'] && options.boolean.includes(key)
// If the key and its aliases aren't in 'args', add the key to 'completions'
const keyAndAliases = [key].concat(aliases[key] || [])
const notInArgs = keyAndAliases.every(val => args.indexOf(`--${val}`) === -1)
if (notInArgs) {
const startsByTwoDashes = s => /^--/.test(s)
const isShortOption = s => /^[^0-9]$/.test(s)
const dashes = !startsByTwoDashes(current) && isShortOption(key) ? '-' : '--'
if (!zshShell) {
completions.push(dashes + key)
} else {
const desc = descs[key] || ''
completions.push(dashes + `${key.replace(/:/g, '\\:')}:${desc.replace('__yargsString__:', '')}`)
let keyAndAliases = [key].concat(aliases[key] || [])
if (negable) keyAndAliases = keyAndAliases.concat(keyAndAliases.map(key => `no-${key}`))
function completeOptionKey (key) {
const notInArgs = keyAndAliases.every(val => args.indexOf(`--${val}`) === -1)
if (notInArgs) {
const startsByTwoDashes = s => /^--/.test(s)
const isShortOption = s => /^[^0-9]$/.test(s)
const dashes = !startsByTwoDashes(current) && isShortOption(key) ? '-' : '--'
if (!zshShell) {
completions.push(dashes + key)
} else {
const desc = descs[key] || ''
completions.push(dashes + `${key.replace(/:/g, '\\:')}:${desc.replace('__yargsString__:', '')}`)
}
}
}
completeOptionKey(key)
if (negable && !!options.default[key]) completeOptionKey(`no-${key}`)
})
}
......
function getProcessArgvBinIndex () {
// The binary name is the first command line argument for:
// - bundled Electron apps: bin argv1 argv2 ... argvn
if (isBundledElectronApp()) return 0
// or the second one (default) for:
// - standard node apps: node bin.js argv1 argv2 ... argvn
// - unbundled Electron apps: electron bin.js argv1 arg2 ... argvn
return 1
}
function isBundledElectronApp () {
// process.defaultApp is either set by electron in an electron unbundled app, or undefined
// see https://github.com/electron/electron/blob/master/docs/api/process.md#processdefaultapp-readonly
return isElectronApp() && !process.defaultApp
}
function isElectronApp () {
// process.versions.electron is either set by electron, or undefined
// see https://github.com/electron/electron/blob/master/docs/api/process.md#processversionselectron-readonly
return !!process.versions.electron
}
function getProcessArgvWithoutBin () {
return process.argv.slice(getProcessArgvBinIndex() + 1)
}
function getProcessArgvBin () {
return process.argv[getProcessArgvBinIndex()]
}
module.exports = {
getProcessArgvBin,
getProcessArgvWithoutBin
}
......@@ -146,7 +146,7 @@ module.exports = function usage (yargs, y18n) {
const deferY18nLookupPrefix = '__yargsString__:'
self.deferY18nLookup = str => deferY18nLookupPrefix + str
const defaultGroup = 'Options:'
const defaultGroup = __('Options:')
self.help = function help () {
if (cachedHelpMessage) return cachedHelpMessage
normalizeAliases()
......@@ -155,6 +155,7 @@ module.exports = function usage (yargs, y18n) {
const base$0 = yargs.customScriptName ? yargs.$0 : path.basename(yargs.$0)
const demandedOptions = yargs.getDemandedOptions()
const demandedCommands = yargs.getDemandedCommands()
const deprecatedOptions = yargs.getDeprecatedOptions()
const groups = yargs.getGroups()
const options = yargs.getOptions()
......@@ -221,7 +222,7 @@ module.exports = function usage (yargs, y18n) {
{ text: command[1] }
)
const hints = []
if (command[2]) hints.push(`[${__('default:').slice(0, -1)}]`) // TODO hacking around i18n here
if (command[2]) hints.push(`[${__('default')}]`)
if (command[3] && command[3].length) {
hints.push(`[${__('aliases:')} ${command[3].join(', ')}]`)
}
......@@ -263,16 +264,24 @@ module.exports = function usage (yargs, y18n) {
if (normalizedKeys.length < 1) return
ui.div(__(groupName))
ui.div(groupName)
// actually generate the switches string --foo, -f, --bar.
const switches = normalizedKeys.reduce((acc, key) => {
acc[key] = [ key ].concat(options.alias[key] || [])
acc[key] = [key].concat(options.alias[key] || [])
.map(sw => {
// for the special positional group don't
// add '--' or '-' prefix.
if (groupName === self.getPositionalGroupName()) return sw
else return (/^[^0-9]$/.test(sw) ? '-' : '--') + sw
else {
return (
// matches yargs-parser logic in which single-digits
// aliases declared with a boolean type are now valid
/^[0-9]$/.test(sw)
? ~options.boolean.indexOf(key) ? '-' : '--'
: sw.length > 1 ? '--' : '-'
) + sw
}
})
.join(', ')
......@@ -294,6 +303,11 @@ module.exports = function usage (yargs, y18n) {
if (~options.number.indexOf(key)) type = `[${__('number')}]`
const extra = [
(key in deprecatedOptions) ? (
typeof deprecatedOptions[key] === 'string'
? `[${__('deprecated: %s', deprecatedOptions[key])}]`
: `[${__('deprecated')}]`
) : null,
type,
(key in demandedOptions) ? `[${__('required')}]` : null,
options.choices && options.choices[key] ? `[${__('choices:')} ${
......@@ -411,6 +425,12 @@ module.exports = function usage (yargs, y18n) {
cachedHelpMessage = this.help()
}
// however this snapshot must be cleared afterwards
// not to be be used by next calls to parse
self.clearCachedHelpMessage = function () {
cachedHelpMessage = undefined
}
// given a set of keys, place any keys that are
// ungrouped under the 'Options:' grouping.
function addUngroupedKeys (keys, aliases, groups) {
......@@ -488,6 +508,8 @@ module.exports = function usage (yargs, y18n) {
// guess the width of the console window, max-width 80.
function windowWidth () {
const maxWidth = 80
// CI is not a TTY
/* c8 ignore next 2 */
if (typeof process === 'object' && process.stdout && process.stdout.columns) {
return Math.min(maxWidth, process.stdout.columns)
} else {
......@@ -520,9 +542,9 @@ module.exports = function usage (yargs, y18n) {
return self
}
let frozens = []
const frozens = []
self.freeze = function freeze () {
let frozen = {}
const frozen = {}
frozens.push(frozen)
frozen.failMessage = failMessage
frozen.failureOutput = failureOutput
......@@ -534,7 +556,7 @@ module.exports = function usage (yargs, y18n) {
frozen.descriptions = descriptions
}
self.unfreeze = function unfreeze () {
let frozen = frozens.pop()
const frozen = frozens.pop()
failMessage = frozen.failMessage
failureOutput = frozen.failureOutput
usages = frozen.usages
......
......@@ -26,7 +26,13 @@ module.exports = function validation (yargs, usage, y18n) {
)
} else {
usage.fail(
__('Not enough non-option arguments: got %s, need at least %s', _s, demandedCommands._.min)
__n(
'Not enough non-option arguments: got %s, need at least %s',
'Not enough non-option arguments: got %s, need at least %s',
_s,
_s,
demandedCommands._.min
)
)
}
} else if (_s > demandedCommands._.max) {
......@@ -37,7 +43,13 @@ module.exports = function validation (yargs, usage, y18n) {
)
} else {
usage.fail(
__('Too many non-option arguments: got %s, maximum of %s', _s, demandedCommands._.max)
__n(
'Too many non-option arguments: got %s, maximum of %s',
'Too many non-option arguments: got %s, maximum of %s',
_s,
_s,
demandedCommands._.max
)
)
}
}
......@@ -49,7 +61,13 @@ module.exports = function validation (yargs, usage, y18n) {
self.positionalCount = function positionalCount (required, observed) {
if (observed < required) {
usage.fail(
__('Not enough non-option arguments: got %s, need at least %s', observed, required)
__n(
'Not enough non-option arguments: got %s, need at least %s',
'Not enough non-option arguments: got %s, need at least %s',
observed,
observed,
required
)
)
}
}
......@@ -60,7 +78,7 @@ module.exports = function validation (yargs, usage, y18n) {
let missing = null
Object.keys(demandedOptions).forEach((key) => {
if (!argv.hasOwnProperty(key) || typeof argv[key] === 'undefined') {
if (!Object.prototype.hasOwnProperty.call(argv, key) || typeof argv[key] === 'undefined') {
missing = missing || {}
missing[key] = demandedOptions[key]
}
......@@ -94,8 +112,8 @@ module.exports = function validation (yargs, usage, y18n) {
Object.keys(argv).forEach((key) => {
if (specialKeys.indexOf(key) === -1 &&
!positionalMap.hasOwnProperty(key) &&
!yargs._getParseContext().hasOwnProperty(key) &&
!Object.prototype.hasOwnProperty.call(positionalMap, key) &&
!Object.prototype.hasOwnProperty.call(yargs._getParseContext(), key) &&
!self.isValidAndSomeAliasIsNotNew(key, aliases)
) {
unknown.push(key)
......@@ -120,15 +138,41 @@ module.exports = function validation (yargs, usage, y18n) {
}
}
self.unknownCommands = function unknownCommands (argv, aliases, positionalMap) {
const commandKeys = yargs.getCommandInstance().getCommands()
const unknown = []
const currentContext = yargs.getContext()
if ((currentContext.commands.length > 0) || (commandKeys.length > 0)) {
argv._.slice(currentContext.commands.length).forEach((key) => {
if (commandKeys.indexOf(key) === -1) {
unknown.push(key)
}
})
}
if (unknown.length > 0) {
usage.fail(__n(
'Unknown command: %s',
'Unknown commands: %s',
unknown.length,
unknown.join(', ')
))
return true
} else {
return false
}
}
// check for a key that is not an alias, or for which every alias is new,
// implying that it was invented by the parser, e.g., during camelization
self.isValidAndSomeAliasIsNotNew = function isValidAndSomeAliasIsNotNew (key, aliases) {
if (!aliases.hasOwnProperty(key)) {
if (!Object.prototype.hasOwnProperty.call(aliases, key)) {
return false
}
const newAliases = yargs.parsed.newAliases
for (let a of [key, ...aliases[key]]) {
if (!newAliases.hasOwnProperty(a) || !newAliases[key]) {
for (const a of [key, ...aliases[key]]) {
if (!Object.prototype.hasOwnProperty.call(newAliases, a) || !newAliases[key]) {
return true
}
}
......@@ -144,7 +188,7 @@ module.exports = function validation (yargs, usage, y18n) {
Object.keys(argv).forEach((key) => {
if (specialKeys.indexOf(key) === -1 &&
options.choices.hasOwnProperty(key)) {
Object.prototype.hasOwnProperty.call(options.choices, key)) {
[].concat(argv[key]).forEach((value) => {
// TODO case-insensitive configurability
if (options.choices[key].indexOf(value) === -1 &&
......@@ -226,7 +270,7 @@ module.exports = function validation (yargs, usage, y18n) {
function keyExists (argv, val) {
// convert string '1' to number 1
let num = Number(val)
const num = Number(val)
val = isNaN(num) ? val : num
if (typeof val === 'number') {
......@@ -331,16 +375,16 @@ module.exports = function validation (yargs, usage, y18n) {
return self
}
let frozens = []
const frozens = []
self.freeze = function freeze () {
let frozen = {}
const frozen = {}
frozens.push(frozen)
frozen.implied = implied
frozen.checks = checks
frozen.conflicting = conflicting
}
self.unfreeze = function unfreeze () {
let frozen = frozens.pop()
const frozen = frozens.pop()
implied = frozen.implied
checks = frozen.checks
conflicting = frozen.conflicting
......
......@@ -8,12 +8,19 @@
"number": "лік",
"array": "масіў",
"required": "неабходна",
"default": "па змаўчанні",
"default:": "па змаўчанні:",
"choices:": "магчымасці:",
"aliases:": "аліасы:",
"generated-value": "згенераванае значэнне",
"Not enough non-option arguments: got %s, need at least %s": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s",
"Too many non-option arguments: got %s, maximum of %s": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s",
"other": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s",
"other": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s"
},
"Missing argument value: %s": {
"one": "Не хапае значэння аргументу: %s",
"other": "Не хапае значэнняў аргументаў: %s"
......
......@@ -8,12 +8,19 @@
"number": "Zahl",
"array": "array",
"required": "erforderlich",
"default": "Standard",
"default:": "Standard:",
"choices:": "Möglichkeiten:",
"aliases:": "Aliase:",
"generated-value": "Generierter-Wert",
"Not enough non-option arguments: got %s, need at least %s": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt",
"Too many non-option arguments: got %s, maximum of %s": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt",
"other": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt",
"other": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt"
},
"Missing argument value: %s": {
"one": "Fehlender Argumentwert: %s",
"other": "Fehlende Argumentwerte: %s"
......
......@@ -8,12 +8,19 @@
"number": "number",
"array": "array",
"required": "required",
"default": "default",
"default:": "default:",
"choices:": "choices:",
"aliases:": "aliases:",
"generated-value": "generated-value",
"Not enough non-option arguments: got %s, need at least %s": "Not enough non-option arguments: got %s, need at least %s",
"Too many non-option arguments: got %s, maximum of %s": "Too many non-option arguments: got %s, maximum of %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Not enough non-option arguments: got %s, need at least %s",
"other": "Not enough non-option arguments: got %s, need at least %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Too many non-option arguments: got %s, maximum of %s",
"other": "Too many non-option arguments: got %s, maximum of %s"
},
"Missing argument value: %s": {
"one": "Missing argument value: %s",
"other": "Missing argument values: %s"
......@@ -38,5 +45,7 @@
"Did you mean %s?": "Did you mean %s?",
"Arguments %s and %s are mutually exclusive" : "Arguments %s and %s are mutually exclusive",
"Positionals:": "Positionals:",
"command": "command"
"command": "command",
"deprecated": "deprecated",
"deprecated: %s": "deprecated: %s"
}
......@@ -8,12 +8,19 @@
"number": "número",
"array": "tabla",
"required": "requerido",
"default": "defecto",
"default:": "defecto:",
"choices:": "selección:",
"aliases:": "alias:",
"generated-value": "valor-generado",
"Not enough non-option arguments: got %s, need at least %s": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s",
"Too many non-option arguments: got %s, maximum of %s": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s",
"other": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s",
"other": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s"
},
"Missing argument value: %s": {
"one": "Falta argumento: %s",
"other": "Faltan argumentos: %s"
......
......@@ -8,12 +8,19 @@
"number": "numero",
"array": "taulukko",
"required": "pakollinen",
"default": "oletusarvo",
"default:": "oletusarvo:",
"choices:": "vaihtoehdot:",
"aliases:": "aliakset:",
"generated-value": "generoitu-arvo",
"Not enough non-option arguments: got %s, need at least %s": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s",
"Too many non-option arguments: got %s, maximum of %s": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s",
"other": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s",
"other": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s"
},
"Missing argument value: %s": {
"one": "Argumentin arvo puuttuu: %s",
"other": "Argumentin arvot puuttuvat: %s"
......
{
"Commands:": "Commandes:",
"Options:": "Options:",
"Examples:": "Exemples:",
"Commands:": "Commandes :",
"Options:": "Options :",
"Examples:": "Exemples :",
"boolean": "booléen",
"count": "comptage",
"string": "chaine de caractère",
"count": "compteur",
"string": "chaîne de caractères",
"number": "nombre",
"array": "tableau",
"required": "requis",
"default:": "défaut:",
"choices:": "choix:",
"default": "défaut",
"default:": "défaut :",
"choices:": "choix :",
"aliases:": "alias :",
"generated-value": "valeur générée",
"Not enough non-option arguments: got %s, need at least %s": "Pas assez d'arguments non-option: reçu %s, besoin d'au moins %s",
"Too many non-option arguments: got %s, maximum of %s": "Trop d'arguments non-option: reçu %s, maximum %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Pas assez d'arguments (hors options) : reçu %s, besoin d'au moins %s",
"other": "Pas assez d'arguments (hors options) : reçus %s, besoin d'au moins %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Trop d'arguments (hors options) : reçu %s, maximum de %s",
"other": "Trop d'arguments (hors options) : reçus %s, maximum de %s"
},
"Missing argument value: %s": {
"one": "Argument manquant: %s",
"other": "Arguments manquants: %s"
"one": "Argument manquant : %s",
"other": "Arguments manquants : %s"
},
"Missing required argument: %s": {
"one": "Argument requis manquant: %s",
"other": "Arguments requis manquants: %s"
"one": "Argument requis manquant : %s",
"other": "Arguments requis manquants : %s"
},
"Unknown argument: %s": {
"one": "Argument inconnu: %s",
"other": "Arguments inconnus: %s"
"one": "Argument inconnu : %s",
"other": "Arguments inconnus : %s"
},
"Unknown command: %s": {
"one": "Commande inconnue : %s",
"other": "Commandes inconnues : %s"
},
"Invalid values:": "Valeurs invalides:",
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Donné: %s, Choix: %s",
"Argument check failed: %s": "Echec de la vérification de l'argument: %s",
"Implications failed:": "Arguments dépendants manquants:",
"Not enough arguments following: %s": "Pas assez d'arguments suivant: %s",
"Invalid JSON config file: %s": "Fichier de configuration JSON invalide: %s",
"Invalid values:": "Valeurs invalides :",
"Argument: %s, Given: %s, Choices: %s": "Argument : %s, donné : %s, choix : %s",
"Argument check failed: %s": "Echec de la vérification de l'argument : %s",
"Implications failed:": "Arguments dépendants manquants :",
"Not enough arguments following: %s": "Pas assez d'arguments après : %s",
"Invalid JSON config file: %s": "Fichier de configuration JSON invalide : %s",
"Path to JSON config file": "Chemin du fichier de configuration JSON",
"Show help": "Affiche de l'aide",
"Show help": "Affiche l'aide",
"Show version number": "Affiche le numéro de version",
"Arguments %s and %s are mutually exclusive" : "Les arguments %s et %s sont mutuellement exclusifs"
"Did you mean %s?": "Vouliez-vous dire %s ?",
"Arguments %s and %s are mutually exclusive" : "Les arguments %s et %s sont mutuellement exclusifs",
"Positionals:": "Arguments positionnels :",
"command": "commande"
}
......@@ -8,12 +8,19 @@
"number": "अंक",
"array": "सरणी",
"required": "आवश्यक",
"default": "डिफॉल्ट",
"default:": "डिफॉल्ट:",
"choices:": "विकल्प:",
"aliases:": "उपनाम:",
"generated-value": "उत्पन्न-मूल्य",
"Not enough non-option arguments: got %s, need at least %s": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है",
"Too many non-option arguments: got %s, maximum of %s": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है",
"other": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य",
"other": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य"
},
"Missing argument value: %s": {
"one": "कुछ तर्को के मूल्य गुम हैं: %s",
"other": "कुछ तर्को के मूल्य गुम हैं: %s"
......
......@@ -8,12 +8,19 @@
"number": "szám",
"array": "tömb",
"required": "kötelező",
"default": "alapértelmezett",
"default:": "alapértelmezett:",
"choices:": "lehetőségek:",
"aliases:": "aliaszok:",
"generated-value": "generált-érték",
"Not enough non-option arguments: got %s, need at least %s": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell",
"Too many non-option arguments: got %s, maximum of %s": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell",
"other": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet",
"other": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet"
},
"Missing argument value: %s": {
"one": "Hiányzó argumentum érték: %s",
"other": "Hiányzó argumentum értékek: %s"
......
......@@ -9,12 +9,19 @@
"string": "string",
"array": "larik",
"required": "diperlukan",
"default": "bawaan",
"default:": "bawaan:",
"aliases:": "istilah lain:",
"choices:": "pilihan:",
"generated-value": "nilai-yang-dihasilkan",
"Not enough non-option arguments: got %s, need at least %s": "Argumen wajib kurang: hanya %s, minimal %s",
"Too many non-option arguments: got %s, maximum of %s": "Terlalu banyak argumen wajib: ada %s, maksimal %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Argumen wajib kurang: hanya %s, minimal %s",
"other": "Argumen wajib kurang: hanya %s, minimal %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Terlalu banyak argumen wajib: ada %s, maksimal %s",
"other": "Terlalu banyak argumen wajib: ada %s, maksimal %s"
},
"Missing argument value: %s": {
"one": "Kurang argumen: %s",
"other": "Kurang argumen: %s"
......
......@@ -8,12 +8,19 @@
"number": "numero",
"array": "vettore",
"required": "richiesto",
"default": "predefinito",
"default:": "predefinito:",
"choices:": "scelte:",
"aliases:": "alias:",
"generated-value": "valore generato",
"Not enough non-option arguments: got %s, need at least %s": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s",
"Too many non-option arguments: got %s, maximum of %s": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s",
"other": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s",
"other": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s"
},
"Missing argument value: %s": {
"one": "Argomento mancante: %s",
"other": "Argomenti mancanti: %s"
......
......@@ -8,12 +8,19 @@
"number": "数値",
"array": "配列",
"required": "必須",
"default": "デフォルト",
"default:": "デフォルト:",
"choices:": "選択してください:",
"aliases:": "エイリアス:",
"generated-value": "生成された値",
"Not enough non-option arguments: got %s, need at least %s": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:",
"Too many non-option arguments: got %s, maximum of %s": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:",
"other": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:",
"other": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:"
},
"Missing argument value: %s": {
"one": "引数が見つかりません: %s",
"other": "引数が見つかりません: %s"
......
......@@ -8,12 +8,19 @@
"number": "숫자",
"array": "배열",
"required": "필수",
"default": "기본",
"default:": "기본:",
"choices:": "선택:",
"aliases:": "별칭:",
"generated-value": "생성된 값",
"Not enough non-option arguments: got %s, need at least %s": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다",
"Too many non-option arguments: got %s, maximum of %s": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다",
"other": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다",
"other": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다"
},
"Missing argument value: %s": {
"one": "인자값을 받지 못했습니다: %s",
"other": "인자값들을 받지 못했습니다: %s"
......
......@@ -8,11 +8,18 @@
"number": "nummer",
"array": "matrise",
"required": "obligatorisk",
"default": "standard",
"default:": "standard:",
"choices:": "valg:",
"generated-value": "generert-verdi",
"Not enough non-option arguments: got %s, need at least %s": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s",
"Too many non-option arguments: got %s, maximum of %s": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s",
"other": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s",
"other": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s"
},
"Missing argument value: %s": {
"one": "Mangler argument verdi: %s",
"other": "Mangler argument verdier: %s"
......
......@@ -8,12 +8,19 @@
"number": "getal",
"array": "lijst",
"required": "verplicht",
"default": "standaard",
"default:": "standaard:",
"choices:": "keuzes:",
"aliases:": "aliassen:",
"generated-value": "gegenereerde waarde",
"Not enough non-option arguments: got %s, need at least %s": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig",
"Too many non-option arguments: got %s, maximum of %s": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig",
"other": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s",
"other": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s"
},
"Missing argument value: %s": {
"one": "Missende argumentwaarde: %s",
"other": "Missende argumentwaarden: %s"
......
......@@ -8,13 +8,18 @@
"number": "nummer",
"array": "matrise",
"required": "obligatorisk",
"default": "standard",
"default:": "standard:",
"choices:": "val:",
"generated-value": "generert-verdi",
"Not enough non-option arguments: got %s, need at least %s":
"Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s",
"Too many non-option arguments: got %s, maximum of %s":
"For mange ikkje-alternativ argument: fekk %s, maksimum %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s",
"other": "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "For mange ikkje-alternativ argument: fekk %s, maksimum %s",
"other": "For mange ikkje-alternativ argument: fekk %s, maksimum %s"
},
"Missing argument value: %s": {
"one": "Manglar argumentverdi: %s",
"other": "Manglar argumentverdiar: %s"
......
......@@ -8,12 +8,19 @@
"number": "liczba",
"array": "tablica",
"required": "wymagany",
"default": "domyślny",
"default:": "domyślny:",
"choices:": "dostępne:",
"aliases:": "aliasy:",
"generated-value": "wygenerowana-wartość",
"Not enough non-option arguments: got %s, need at least %s": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s",
"Too many non-option arguments: got %s, maximum of %s": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s",
"other": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s",
"other": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s"
},
"Missing argument value: %s": {
"one": "Brak wartości dla argumentu: %s",
"other": "Brak wartości dla argumentów: %s"
......
......@@ -8,11 +8,18 @@
"number": "número",
"array": "arranjo",
"required": "requerido",
"default": "padrão",
"default:": "padrão:",
"choices:": "escolhas:",
"generated-value": "valor-gerado",
"Not enough non-option arguments: got %s, need at least %s": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s",
"Too many non-option arguments: got %s, maximum of %s": "Excesso de argumentos não opcionais: recebido %s, máximo de %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s",
"other": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Excesso de argumentos não opcionais: recebido %s, máximo de %s",
"other": "Excesso de argumentos não opcionais: recebido %s, máximo de %s"
},
"Missing argument value: %s": {
"one": "Falta valor de argumento: %s",
"other": "Falta valores de argumento: %s"
......
......@@ -12,8 +12,14 @@
"choices:": "opções:",
"aliases:": "sinônimos:",
"generated-value": "valor-gerado",
"Not enough non-option arguments: got %s, need at least %s": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s",
"Too many non-option arguments: got %s, maximum of %s": "Excesso de argumentos: recebido %s, máximo de %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s",
"other": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Excesso de argumentos: recebido %s, máximo de %s",
"other": "Excesso de argumentos: recebido %s, máximo de %s"
},
"Missing argument value: %s": {
"one": "Falta valor de argumento: %s",
"other": "Falta valores de argumento: %s"
......
......@@ -8,12 +8,19 @@
"number": "число",
"array": "массив",
"required": "необходимо",
"default": "по умолчанию",
"default:": "по умолчанию:",
"choices:": "возможности:",
"aliases:": "алиасы:",
"generated-value": "генерированное значение",
"Not enough non-option arguments: got %s, need at least %s": "Недостаточно неопционных аргументов: есть %s, нужно как минимум %s",
"Too many non-option arguments: got %s, maximum of %s": "Слишком много неопционных аргументов: есть %s, максимум допустимо %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Недостаточно неопционных аргументов: есть %s, нужно как минимум %s",
"other": "Недостаточно неопционных аргументов: есть %s, нужно как минимум %s"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Слишком много неопционных аргументов: есть %s, максимум допустимо %s",
"other": "Слишком много неопционных аргументов: есть %s, максимум допустимо %s"
},
"Missing argument value: %s": {
"one": "Не хватает значения аргумента: %s",
"other": "Не хватает значений аргументов: %s"
......
......@@ -8,12 +8,19 @@
"number": "ตัวเลข",
"array": "อาเรย์",
"required": "จำเป็น",
"default": "ค่าเริ่มต้",
"default:": "ค่าเริ่มต้น",
"choices:": "ตัวเลือก",
"aliases:": "เอเลียส",
"generated-value": "ค่าที่ถูกสร้างขึ้น",
"Not enough non-option arguments: got %s, need at least %s": "ใส่อาร์กิวเมนต์ไม่ครบตามจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการอย่างน้อย %s ค่า",
"Too many non-option arguments: got %s, maximum of %s": "ใส่อาร์กิวเมนต์เกินจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการมากที่สุด %s ค่า",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "ใส่อาร์กิวเมนต์ไม่ครบตามจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการอย่างน้อย %s ค่า",
"other": "ใส่อาร์กิวเมนต์ไม่ครบตามจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการอย่างน้อย %s ค่า"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "ใส่อาร์กิวเมนต์เกินจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการมากที่สุด %s ค่า",
"other": "ใส่อาร์กิวเมนต์เกินจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการมากที่สุด %s ค่า"
},
"Missing argument value: %s": {
"one": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s",
"other": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s"
......
......@@ -8,12 +8,19 @@
"number": "numara",
"array": "array",
"required": "zorunlu",
"default": "varsayılan",
"default:": "varsayılan:",
"choices:": "seçimler:",
"aliases:": "takma adlar:",
"generated-value": "oluşturulan-değer",
"Not enough non-option arguments: got %s, need at least %s": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli",
"Too many non-option arguments: got %s, maximum of %s": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli",
"other": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s",
"other": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s"
},
"Missing argument value: %s": {
"one": "Eksik argüman değeri: %s",
"other": "Eksik argüman değerleri: %s"
......
......@@ -8,11 +8,18 @@
"number": "数字",
"array": "数组",
"required": "必需",
"default": "默认值",
"default:": "默认值:",
"choices:": "可选值:",
"generated-value": "生成的值",
"Not enough non-option arguments: got %s, need at least %s": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个",
"Too many non-option arguments: got %s, maximum of %s": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个",
"other": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个",
"other": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个"
},
"Missing argument value: %s": {
"one": "没有给此选项指定值:%s",
"other": "没有给这些选项指定值:%s"
......
......@@ -8,12 +8,19 @@
"number": "數字",
"array": "陣列",
"required": "必須",
"default": "預設值",
"default:": "預設值:",
"choices:": "可選值:",
"aliases:": "別名:",
"generated-value": "生成的值",
"Not enough non-option arguments: got %s, need at least %s": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個",
"Too many non-option arguments: got %s, maximum of %s": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個",
"Not enough non-option arguments: got %s, need at least %s": {
"one": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個",
"other": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個"
},
"Too many non-option arguments: got %s, maximum of %s": {
"one": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個",
"other": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個"
},
"Missing argument value: %s": {
"one": "此引數無指定值:%s",
"other": "這些引數無指定值:%s"
......
{
"_from": "yargs@15.1.0",
"_id": "yargs@15.1.0",
"_from": "yargs@15.3.1",
"_id": "yargs@15.3.1",
"_inBundle": false,
"_integrity": "sha512-T39FNN1b6hCW4SOIk1XyTOWxtXdcen0t+XYrysQmChzSipvhBO8Bj0nK1ozAasdk24dNWuMZvr4k24nz+8HHLg==",
"_integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==",
"_location": "/yargs",
"_phantomChildren": {
"camelcase": "5.3.1",
"decamelize": "1.2.0"
},
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "yargs@15.1.0",
"raw": "yargs@15.3.1",
"name": "yargs",
"escapedName": "yargs",
"rawSpec": "15.1.0",
"rawSpec": "15.3.1",
"saveSpec": null,
"fetchSpec": "15.1.0"
"fetchSpec": "15.3.1"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/yargs/-/yargs-15.1.0.tgz",
"_shasum": "e111381f5830e863a89550bd4b136bb6a5f37219",
"_spec": "yargs@15.1.0",
"_where": "C:\\Users\\thequ\\Documents\\Mynij\\Mynij-unit-tests\\Milestone1",
"_resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz",
"_shasum": "9505b472763963e54afe60148ad27a330818e98b",
"_spec": "yargs@15.3.1",
"_where": "/home/alexandra/Documents/Mynij-unit-tests/Milestone2",
"bugs": {
"url": "https://github.com/yargs/yargs/issues"
},
......@@ -47,23 +44,23 @@
"string-width": "^4.2.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^16.1.0"
"yargs-parser": "^18.1.1"
},
"deprecated": false,
"description": "yargs the modern, pirate-themed, successor to optimist.",
"devDependencies": {
"c8": "^6.0.1",
"c8": "^7.0.0",
"chai": "^4.2.0",
"chalk": "^2.4.2",
"coveralls": "^3.0.3",
"chalk": "^3.0.0",
"coveralls": "^3.0.9",
"cpr": "^3.0.1",
"cross-spawn": "^6.0.4",
"cross-spawn": "^7.0.0",
"es6-promise": "^4.2.5",
"hashish": "0.0.4",
"mocha": "^5.2.0",
"rimraf": "^2.6.3",
"standard": "^12.0.1",
"which": "^1.3.1",
"mocha": "^7.0.0",
"rimraf": "^3.0.0",
"standard": "^14.0.0",
"which": "^2.0.0",
"yargs-test-extends": "^1.0.1"
},
"engines": {
......@@ -96,15 +93,15 @@
"url": "git+https://github.com/yargs/yargs.git"
},
"scripts": {
"coverage": "c8 report --reporter=text-lcov | coveralls",
"coverage": "c8 report --check-coverage",
"fix": "standard --fix",
"posttest": "standard",
"test": "c8 --reporter=html --reporter=text mocha --require ./test/before.js --timeout=12000 --check-leaks"
"test": "c8 mocha --require ./test/before.js --timeout=12000 --check-leaks"
},
"standard": {
"ignore": [
"**/example/**"
]
},
"version": "15.1.0"
"version": "15.3.1"
}
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment