-
Notifications
You must be signed in to change notification settings - Fork 19
Command line
Terminal jockeys rejoice. Shoes has always had a command line but no one talks about it. Shoes 3.2 even helps Shoes/Windows behave better when run from the console.
Shoes may spit out a warning message or two when run from the console. Many of those warnings are not a problem with Shoes. Windows complains about fontconfig (but fontconfig isn't use so there you go). The lastest Raspbian spits out all manner of Gtk warnings. It's not Shoes - it does that for lots of other GUI programs on the Pi.
The switches:
- -h displays the help
- -m displays the manual
- -c displays the Cobbler (Maintain Shoes)
- -d invokes the byebug debugger
- -e profile the script
- -g sends the rest of the command line to Ruby gems
- --ruby send the rest of the command line to Ruby (no Shoes gui)
The last two deserve some explanations. Shoes has its own copy of ruby and gem programs. You can use them to do anything $ gem <strings>
and $ ruby <strings>
would do. Examples:
- -g env is equivalent to gem env - tells about the Gem setup
- -g install xxx would install gem xxx
- --ruby -e "puts RUBY_PLATFORM"
- --ruby my-non-gui-script.rb
Profiling and debugging have their own Wiki pages.
You wouldn't want to launch a Webrick or Jekyll server that way but you could try and it might work. Note: Shoes will with call itself with a --ruby command when installing some Gems from a Shoes Gem.setup. Don't push the --ruby too hard, that Ruby inside is not a substitute for installing Ruby if you want a general purpose Ruby command line. One final note: There are SHOES unique constants and ENV settings defined in the Ruby started by --ruby and -g. It's handy for some situations.
Linux:
As mentioned in "where's my files", the Linux Shoes binary is ~/.shoes/federales/shoes From the terminal ~/.shoes/federales/shoes -h (or -m) or <path-to-script.rb> or path to .shy
If you'd like to shorten that then One could do sudo ln -s ~/.shoes/walkabout/shoes /usr/local/bin/cshoes
or
set an alias $ alias cshoes='~/.shoes/walkabout/shoes'
in your ~/.bashrc Both
have tradeoff's that Shoes won't make for you. If it was me, and it's not, and I have
~/bin in my $PATH I'd lean towards ln -s ~/.shoes/walkabout/shoes ~/bin/cshoes
But that's just me.
OSX:
To use Shoes from the command line you'll need to create a cshoes
script.
It's easy to do. Quit Shoes, then click on Shoes.app, which will launch the Shoes welcome screen. Select "Maintain Shoes" and push the
cshoes
button. Then select the Shoes.app you installed and where you want to
put the cshoes
script. See Command line for OSX
It's just a small bash script so take a look at it. It's hardcoded to where your installed Shoes is. You could have multiples if you like, each pointing to different Shoes installed on you system. The command line savvy folks would move it to /usr/local/bin or to ~/bin if they have ~/bin in their PATH.
Windows:
Shoes 3.2 has two small exe's, shoes.exe
and cshoes.exe
, the difference is cshoes.exe is for running shoes from a Console. Any puts or C level printf output is displayed. Use cshoes.exe if you want to use the console which is what this section is about.