From 1f3446e4f1f4654079d40f624f7da909f912f7fd Mon Sep 17 00:00:00 2001 From: Ricardo Banffy Date: Thu, 21 Sep 2017 11:00:15 +0100 Subject: [PATCH 1/3] Add short aliases to help --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index d5cf324..315cbcd 100644 --- a/index.js +++ b/index.js @@ -19,14 +19,17 @@ const helpSections = [ }, { name: 'lowercase', + alias: 'l', description: 'Output in lowercase.' }, { name: 'no-suffix', + alias: 'm', description: "Don't add a suffix." }, { name: 'hostname', + alias: 'h', description: 'Output a sensible hostname.' } ] From ab526f3390c59b5170c5fb408fe9724a63c75e94 Mon Sep 17 00:00:00 2001 From: Ricardo Banffy Date: Thu, 21 Sep 2017 11:00:35 +0100 Subject: [PATCH 2/3] Scope reduction --- index.js | 2 +- lib/nsaname.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 315cbcd..712ce94 100644 --- a/index.js +++ b/index.js @@ -69,7 +69,7 @@ const options = commandLineArgs(commandLineOptionDefinitions) if (options.help) { console.log(usage) } else { - var name = nsaname.getNSAName( + let name = nsaname.getNSAName( !(options.hostname || options['no-suffix']), options.hostname ? '-' : '') if (options.hostname) { diff --git a/lib/nsaname.js b/lib/nsaname.js index 109687a..0274b59 100644 --- a/lib/nsaname.js +++ b/lib/nsaname.js @@ -320,7 +320,7 @@ const suffixes = [ * @return {string} */ function getNSAName (suffix, separator) { - var nsaname = first[Math.floor(Math.random() * first.length)] + + let nsaname = first[Math.floor(Math.random() * first.length)] + separator + second[Math.floor(Math.random() * second.length)] if (suffix) { From b248e78a91effb8542856151aa6f19c17a5e89d6 Mon Sep 17 00:00:00 2001 From: Ricardo Banffy Date: Thu, 21 Sep 2017 11:00:48 +0100 Subject: [PATCH 3/3] Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eca5bec..46d7e4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nsaname", - "version": "1.0.10", + "version": "1.0.11", "description": "Like petname, but for naming secret projects and tools.", "main": "index.js", "author": "Ricardo Banffy ",