Created
October 4, 2013 22:07
-
-
Save l3kn/6833629 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'commander/import' | |
require 'nopoint/version' | |
require 'nopoint' | |
program :name, 'nopoint' | |
program :version, Nopoint::VERSION | |
program :description, 'Slideshow generator' | |
default_command :help | |
command :new do |c| | |
c.syntax = 'nopoint new PATH [options]' | |
c.summary = 'Scaffold a new Slide' | |
c.description = 'Creates a new Nopoint scaffold at $PATH' | |
c.action do |args, options| | |
Nopoint::Commands::New.process(args, options) | |
end | |
end | |
command :serve do |c| | |
c.syntax = 'nopoint serve [options]' | |
c.summary = 'Start a webserver' | |
c.description = 'Serve your slideshow locally' | |
c.option '-w', '--watch', 'watch for changes and rebuild' | |
c.action do |args, options| | |
# let the build command know that we are serving | |
options.default :serving => true | |
Nopoint::Commands::Build.process(options) | |
Nopoint::Commands::Serve.process(options) | |
end | |
end | |
command :build do |c| | |
c.syntax = 'nopoint build [options]' | |
c.summary = 'Generate slideshow' | |
c.description = 'Converts the slideshow to a static html site' | |
c.option '-w', '--watch', 'watch for changes and rebuild' | |
c.action do |args, options| | |
Nopoint::Commands::Build.process(options) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment