[julia-users] Re: Bindling a command line utility with a package

2014-04-29 Thread Mike Innes
I'm not sure that packages should export main() functions – that's going to complicated things when a user wants to require CRC and define their own main(). How about leaving it unexported and using julia -e "using PKG; PKG.main(ARGS)"? On Sunday, 27 April 2014 16:12:41 UTC+1, andrew cooke wro

[julia-users] Re: Bindling a command line utility with a package

2014-04-27 Thread andrew cooke
Just to follow-up on this. The simplest way to bundle a command line utility with a package seems to be: - use ArgeParse as normal and define a main(ARGS) function - export the main() function from the package - tell the user to call or alias julia -e "using PKG; main(ARGS)" This works because

[julia-users] Re: Bindling a command line utility with a package

2014-04-22 Thread andrew cooke
oh of course! yes, that would help. although it's still buried in some weird direction under .julia (unless i use some kind of install script), also i think something like julia -e "using CRC; main(ARGS)" might be a useful alternative, but i need to see if i can somehow ignore the "-e".

[julia-users] Re: Bindling a command line utility with a package

2014-04-22 Thread Simon Kornblith
I think you should be able to put: #!/usr/bin/env julia at the top of the file and chmod a+rx. Then you can symlink it to /usr/local/bin, add the directory to PATH, etc. On Tuesday, April 22, 2014 8:07:27 PM UTC-4, andrew cooke wrote: > > > I have a package that also, in a separate file, has a