Arc Forumnew | comments | leaders | submitlogin
Is there a library for command line arguments parsing in Arc?
2 points by svetlyak40wt 3803 days ago | 6 comments


1 point by akkartik 3802 days ago | link

Ohh, did you mean bindings for http://download.plt-scheme.org/doc/html/reference/Command-Li...?

-----

2 points by svetlyak40wt 3799 days ago | link

Yes, I mean exactly something like this :)

-----

2 points by akkartik 3798 days ago | link

Great. We still needed some way to pass args to arc, so my changes aren't totally useless.

-----

1 point by akkartik 3802 days ago | link

I'm still trying to get the solution to work, but the last time this came up was http://arclanguage.org/item?id=10344.

-----

1 point by akkartik 3802 days ago | link

Ok, try it now:

  anarki $ git pull  # should now have a file called 'arc'
Now an executable file like this (called say x.arc) works:

  #!/PATH/TO/arc
  (prn argv)  ; argv now contains commandline args
Try it out:

  anarki $ ./x.arc a b c
  (./x.arc a b c)
The repo is a little messy now. I had to create a new asv.scm that looks substantially like as.scm, and the 'arc' script is in addition to the older 'arc.sh' which is for interactive use (and which I don't use, preferring to directly 'racket -f as.scm'). Anybody have suggestions for either? Should we rename the old arc.sh to 'iarc'?

-----

1 point by akkartik 3798 days ago | link

I've cleaned up the messiness and duplication. The hoary as.scm is now boot.scm, and it's going to mess up all our 'racket -f as.scm' muscle memory. The top level script is now arc rather than arc.sh. Let me know if you were relying on its ability to run several arc files at the commandline. Or just revert my change :)

https://github.com/arclanguage/anarki/commit/a03a21fb84

-----