bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-08-16 05:14:38 +03:00
parent 258e0443e3
commit 79f6fa6e93
2 changed files with 6 additions and 6 deletions

View File

@ -967,10 +967,10 @@ object.Constructor('Parser', {
main = context.scriptName +' '+ main main = context.scriptName +' '+ main
rest.unshift(main) } rest.unshift(main) }
// normalize the argv... // normalize the argv...
if(main != null){ if(main != null && rest[0] == process.execPath){
rest.splice(0, rest.indexOf(main)) rest.splice(0, 2)
rest.includes(main) rest.unshift(main) }
|| rest.unshift(main) }
// script stuff... // script stuff...
var script = parsed.script = rest.shift() var script = parsed.script = rest.shift()
var basename = script.split(/[\\\/]/).pop() var basename = script.split(/[\\\/]/).pop()

View File

@ -1,6 +1,6 @@
{ {
"name": "ig-argv", "name": "ig-argv",
"version": "2.13.0", "version": "2.13.1",
"description": "simple argv parser", "description": "simple argv parser",
"main": "argv.js", "main": "argv.js",
"scripts": { "scripts": {
@ -24,6 +24,6 @@
"homepage": "https://github.com/flynx/argv.js#readme", "homepage": "https://github.com/flynx/argv.js#readme",
"dependencies": { "dependencies": {
"colors": "^1.4.0", "colors": "^1.4.0",
"ig-object": "^5.1.15" "ig-object": "^5.2.6"
} }
} }