Skip to content

passing command line arguments to lsc executable still not working? #1013

Closed

Description

my apologies if i am being stupid, but i can not manage to pass arguments to a #!/usr/bin/env lsc executable on the command line, as lsc attempts to read them as additional input files

my expected behavior was for any arguments after the input file to be passed onto the script and available with process.argv

i have tried with -- as suggested in #610, and i have been reading similar issues (#569, #587, #589, etc) to find a solution to no avail

any guidance would be appreciated.

Activity

  1. rhendric commented on Mar 6, 2018

    @rhendric
    Collaborator

    Would you please share:

    • the script you're trying to run
    • your Node.js version (node --version)
    • your lsc version (lsc --version)
  2. rhendric commented on Mar 6, 2018

    @rhendric
    Collaborator

    The code you pasted doesn't compile with lsc 1.5.0 (try it on http://livescript.net/). Either that's not literally the code you've been trying to run, or maybe you have a rather old lsc hanging around somewhere?

  3. rhendric commented on Mar 6, 2018

    @rhendric
    Collaborator

    I'm not sure what's going wrong for you. Here's me running that same code in a fresh Docker container with Node 9.4 and LiveScript 1.5:

    % docker run -it --rm node:9.4 bash
    root@1fab59a7aae2:/# npm install -g livescript
    /usr/local/bin/lsc -> /usr/local/lib/node_modules/livescript/bin/lsc
    + livescript@1.5.0
    added 9 packages in 1.07s
    root@1fab59a7aae2:/# cat > temp.ls
    for arg in process.argv
    	console.log arg
    root@1fab59a7aae2:/# lsc temp.ls arg1 arg2
    /usr/local/bin/lsc
    /temp.ls
    arg1
    arg2
    root@1fab59a7aae2:/# 
    
  4. rhendric commented on Mar 6, 2018

    @rhendric
    Collaborator

    Ahhh, you're running LiveScript from master, not the published version? I can reproduce the issue on master.

    If running published 1.5.0 is an option for you, I would recommend that as a workaround until I get this sorted out.

  5. self-assigned this
    on Mar 6, 2018
  6. added and removed on Mar 6, 2018
  7. rhendric commented on Mar 6, 2018

    @rhendric
    Collaborator

    Well, since you're already hanging out on the bleeding edge, you can take the fix/LiveScript-1013 branch of my fork for a spin and see if that works for you. My usual approach is to wait around a week for community feedback before merging most changes to master here, so if you're impatient for a fix, that's the thing to do.

  8. rhendric commented on Mar 6, 2018

    @rhendric
    Collaborator

    Right here on GitHub, for the most part. I'm not generally on IRC unless I'm asked to be, but some people hang out in a #livescript channel on Freenode as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions