From 981c1c79fc0bf5db18dd6d3ec10115fe2b2571b8 Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Thu, 30 Aug 2018 08:00:04 -0700 Subject: [PATCH 01/17] version 0.0.16 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1f9d216..61531b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pyret-npm", - "version": "0.0.15", + "version": "0.0.16", "description": "The CLI for the Pyret programming language", "files": [ "pyret.js", From 4e3e9f411aa7574c4c3d36e7f92781d451ecc5b4 Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Mon, 20 Jul 2020 17:31:03 -0700 Subject: [PATCH 02/17] version bump again --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 61531b5..f75a14d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pyret-npm", - "version": "0.0.16", + "version": "0.0.17", "description": "The CLI for the Pyret programming language", "files": [ "pyret.js", From 025b104f85f2968fcd18cb75882150cb4de35d54 Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Tue, 21 Jul 2020 08:03:30 -0700 Subject: [PATCH 03/17] bump for compiling libraries with (needed for module compilation, but slow) annotations --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f75a14d..36e14af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pyret-npm", - "version": "0.0.17", + "version": "0.0.18", "description": "The CLI for the Pyret programming language", "files": [ "pyret.js", From 8302a1e2e80bd1987acbf4d664fe68bb9db84ce1 Mon Sep 17 00:00:00 2001 From: Joe Gibbs Politz Date: Mon, 10 May 2021 10:37:23 -0700 Subject: [PATCH 04/17] bump package version to redeploy --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 61531b5..8032724 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pyret-npm", - "version": "0.0.16", + "version": "0.0.19", "description": "The CLI for the Pyret programming language", "files": [ "pyret.js", From 80ce9c224c6980787ae8317056e5e6f90b2ffda2 Mon Sep 17 00:00:00 2001 From: Joe Politz Date: Fri, 20 Aug 2021 19:13:09 -0700 Subject: [PATCH 05/17] bump version, points at server-dev containing use context --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8032724..6d03c4c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pyret-npm", - "version": "0.0.19", + "version": "0.0.22", "description": "The CLI for the Pyret programming language", "files": [ "pyret.js", From 0de6fbcb7ab5fcc9879c1f8508da71c651f05aeb Mon Sep 17 00:00:00 2001 From: Joe Politz Date: Fri, 20 Aug 2021 19:14:34 -0700 Subject: [PATCH 06/17] new commit to trigger build From 12d7eccaa9912b4f4adda6514a78ea1e9f74a5d2 Mon Sep 17 00:00:00 2001 From: Joe Politz Date: Fri, 20 Aug 2021 19:27:08 -0700 Subject: [PATCH 07/17] reencrypt token for moving .org -> .com --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e956092..646e950 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,4 +10,4 @@ deploy: provider: npm email: joe.politz@gmail.com api_key: - secure: o8BnblLlSjc0QT89NxDbbaBn/5q1LOFi0JRhiFCqLWw6lwJlEWgg4t6Stnv+/i5sCnnTEnCwdJoB/8OK7nNeQOlfYfwyu/mHGybOOrmTi7+qxL8OlXXDku72BdxTPYmUyB7f8jVDbpt8k3TL76YWpi8s+h9O0sUELM8QVaT2CI2nLNFdmzwErUSOJF5+SP+Eeo2XclQt1BvoM6V/GKb6XBDx4zV+gXinjyCggb6bNPdbvbQ0zXbVrSR0Dxrzuj9E3o16DhPkP8wvNH4ujAfZhDKvZ05MgxMecjUXuBJgTS84L5DS10HapQfB9VgRWvgoa/oeP60xBLD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17 00:00:00 2001 From: Joe Politz Date: Fri, 20 Aug 2021 19:56:33 -0700 Subject: [PATCH 08/17] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d03c4c..3660c5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pyret-npm", - "version": "0.0.22", + "version": "0.0.23", "description": "The CLI for the Pyret programming language", "files": [ "pyret.js", From ef7d3710acf403624a70b917a58157f059071bef Mon Sep 17 00:00:00 2001 From: Joe Politz Date: Wed, 23 Aug 2023 13:47:05 -0700 Subject: [PATCH 09/17] kick version up for new horizon changes --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3660c5c..0ccd96a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pyret-npm", - "version": "0.0.23", + "version": "0.0.24", "description": "The CLI for the Pyret programming language", "files": [ "pyret.js", From 46a8293bedf9ec33d6b9d1cbb29609a1625c73c8 Mon Sep 17 00:00:00 2001 From: Joe Politz Date: Wed, 23 Aug 2023 14:18:32 -0700 Subject: [PATCH 10/17] kick update version for server update to use correct compiled dir --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0ccd96a..bbfe357 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pyret-npm", - "version": "0.0.24", + "version": "0.0.25", "description": "The CLI for the Pyret programming language", "files": [ "pyret.js", From 3bc48cb9b03cbeaebcbb3266bd3364791bf88835 Mon Sep 17 00:00:00 2001 From: Joe Politz Date: Tue, 29 Aug 2023 08:07:01 -0700 Subject: [PATCH 11/17] Bump version for iolib --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bbfe357..9ae0490 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pyret-npm", - "version": "0.0.25", + "version": "0.0.26", "description": "The CLI for the Pyret programming language", "files": [ "pyret.js", From 7666405425dc74bdd1d918c9260266d4f8e5225c Mon Sep 17 00:00:00 2001 From: Joe Politz Date: Tue, 19 Sep 2023 10:52:01 -0700 Subject: [PATCH 12/17] Update for more complete libraries (pyret-lang@76bc6aa61) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9ae0490..ad4ec01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pyret-npm", - "version": "0.0.26", + "version": "0.0.27", "description": "The CLI for the Pyret programming language", "files": [ "pyret.js", From f47321004a1aa0fadd1d2e248c55e3a9f1096245 Mon Sep 17 00:00:00 2001 From: Ron Zuckerman Date: Sat, 23 Dec 2023 14:02:28 -0600 Subject: [PATCH 13/17] Add example program with arguments --- ahoy-world-args.arr | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ahoy-world-args.arr diff --git a/ahoy-world-args.arr b/ahoy-world-args.arr new file mode 100644 index 0000000..e3cdb94 --- /dev/null +++ b/ahoy-world-args.arr @@ -0,0 +1,7 @@ +import cmdline-lib as CL +args = CL.command-line-arguments() +if args.length() >= 3: + print("Ahoy, " + args.get(2) + "!\n") +else: + print("Ahoy, world!\n") +end From 30c8516f51771cd49944bdc0dd1713fe51255414 Mon Sep 17 00:00:00 2001 From: Ron Zuckerman Date: Sat, 23 Dec 2023 19:14:50 -0600 Subject: [PATCH 14/17] Don't pass '--' argumemnt --- ahoy-world-args.arr | 6 +++--- client-lib.js | 4 ++-- pyret.js | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ahoy-world-args.arr b/ahoy-world-args.arr index e3cdb94..b8b617a 100644 --- a/ahoy-world-args.arr +++ b/ahoy-world-args.arr @@ -1,7 +1,7 @@ import cmdline-lib as CL args = CL.command-line-arguments() -if args.length() >= 3: - print("Ahoy, " + args.get(2) + "!\n") +if args.length() >= 2: + print("Ahoy " + args.get(1) + "!\n") else: - print("Ahoy, world!\n") + print("Ahoy world!\n") end diff --git a/client-lib.js b/client-lib.js index 3b414db..b98deaa 100644 --- a/client-lib.js +++ b/client-lib.js @@ -177,8 +177,8 @@ function start(options) { log("Successful compile response"); if(!options.meta.norun) { var argv = options["_unknown"] || []; - if (argv.length < 1 || argv[0] != "--") { - argv = ["--"].concat(argv); + if (argv.length > 0 && argv[0] == "--") { + argv = argv.slice(1); } process.nextTick(() => runProgram(options["pyret-options"]["outfile"], argv)); } diff --git a/pyret.js b/pyret.js index d6e80d0..d1bb871 100755 --- a/pyret.js +++ b/pyret.js @@ -55,8 +55,8 @@ const usages = [ {col: '$ cat ahoy-world-args.arr'}, {col: 'import cmdline-lib as CL'}, {col: 'args = CL.command-line-arguments()'}, - {col: 'if args.length() >= 3:'}, - {col: ' print("Ahoy " + args.get(2) + "!\\\\n")'}, + {col: 'if args.length() >= 2:'}, + {col: ' print("Ahoy " + args.get(1) + "!\\\\n")'}, {col: 'else:'}, {col: ' print("Ahoy world!\\\\n")'}, {col: 'end'}, @@ -68,7 +68,7 @@ const usages = [ { content: [ '', - ' This command suppressed the progress indication, disabled checks, and passed two command-line arguments: {bold "--"} (index 1) and {bold "Captain"} (index 2). It should be noted that the index 0 contains the path to the compiled {underline .jarr} file', + ' This command suppresses the progress indication, disables checks, and passed one command-line argument: {bold "Captain"} (index 2). The {bold "--"} argument is only needed so that {bold pyret} does not interpret it. It should be noted that the index 0 argument contains the path to the compiled {underline .jarr} file.', ] }, { From 4ef3e8ec9ef64d1e768dc2a300c269143f6c95c3 Mon Sep 17 00:00:00 2001 From: Ron Zuckerman Date: Sat, 23 Dec 2023 19:15:37 -0600 Subject: [PATCH 15/17] Find index in help message --- pyret.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyret.js b/pyret.js index d1bb871..0d02dc3 100755 --- a/pyret.js +++ b/pyret.js @@ -68,7 +68,7 @@ const usages = [ { content: [ '', - ' This command suppresses the progress indication, disables checks, and passed one command-line argument: {bold "Captain"} (index 2). The {bold "--"} argument is only needed so that {bold pyret} does not interpret it. It should be noted that the index 0 argument contains the path to the compiled {underline .jarr} file.', + ' This command suppresses the progress indication, disables checks, and passed one command-line argument: {bold "Captain"} (index 1). The {bold "--"} argument is only needed so that {bold pyret} does not interpret it. It should be noted that the index 0 argument contains the path to the compiled {underline .jarr} file.', ] }, { From 5ce5f36948d86b37b44ecc9b276058d14644b200 Mon Sep 17 00:00:00 2001 From: Ron Zuckerman Date: Sat, 23 Dec 2023 19:38:16 -0600 Subject: [PATCH 16/17] Fix some typos --- pyret.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyret.js b/pyret.js index 0d02dc3..221e276 100755 --- a/pyret.js +++ b/pyret.js @@ -68,7 +68,7 @@ const usages = [ { content: [ '', - ' This command suppresses the progress indication, disables checks, and passed one command-line argument: {bold "Captain"} (index 1). The {bold "--"} argument is only needed so that {bold pyret} does not interpret it. It should be noted that the index 0 argument contains the path to the compiled {underline .jarr} file.', + ' This command suppresses the progress indication, disables checks, and passes one command-line argument to {underline ahoy-world-args.arr}: {bold "Captain"} (index 1). The {bold "--"} argument is only needed so that {bold pyret} does not interpret it. It should be noted that the index 0 argument contains the path to the compiled {underline .jarr} file.', ] }, { From cb2263485d158195e347a0315bf616aaf9273309 Mon Sep 17 00:00:00 2001 From: Ron Zuckerman Date: Sat, 23 Dec 2023 19:49:49 -0600 Subject: [PATCH 17/17] Don't allow unknown arguments if no program --- pyret.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyret.js b/pyret.js index 221e276..4b1cf24 100755 --- a/pyret.js +++ b/pyret.js @@ -302,4 +302,9 @@ if(!options["pyret-options"]["outfile"] && options["pyret-options"]["program"]) } } +if (options["_unknown"] && !options["pyret-options"]["program"]) { + printUsage(); + process.exit(1); +} + pyretClient.start(options);