Skip to content

How to Pass Command Line Arguments? #4

@jrg94

Description

@jrg94

I currently maintain the Sample Programs repo, and I'm looking to expand our collection of Pyret scripts. I quite like the language, but I'm running into an issue where I can't seem to figure out how to provide command line arguments. We use this npm package in a Docker image, so we can run Pyret scripts. Is there a way to pass arguments to this compiler? Here are all the files and whatnot for reference:

A simple script that I'd like to implement is capitalize which just capitalizes the first letter of a user's input and prints the result. The script itself is pretty straightforward to write, but I can't figure out how to get something like the following to work:

pyret -qk capitalize.arr "capitalize"

Unfortunately, the command above produces the help dialog instead. After digging through docs, I was unable to solve this problem. Others seem to be having the same issue. Any help would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions