From c7bc76269c3d3c87235000f5fde4c51491b738ac Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Wed, 23 Sep 2015 17:32:33 -0700 Subject: [PATCH] Abort if no subcommand. Fixes #3412 --- lib/jekyll/deprecator.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/jekyll/deprecator.rb b/lib/jekyll/deprecator.rb index dfd3183c..8fda510b 100644 --- a/lib/jekyll/deprecator.rb +++ b/lib/jekyll/deprecator.rb @@ -3,9 +3,10 @@ module Jekyll extend self def process(args) - no_subcommand(args) arg_is_present? args, "--server", "The --server command has been replaced by the \ 'serve' subcommand." + arg_is_present? args, "--serve", "The --server command has been replaced by the \ + 'serve' subcommand." arg_is_present? args, "--no-server", "To build Jekyll without launching a server, \ use the 'build' subcommand." arg_is_present? args, "--auto", "The switch '--auto' has been replaced with '--watch'." @@ -16,12 +17,13 @@ module Jekyll arg_is_present? args, "--paginate", "The 'paginate' setting can only be set in your \ config files." arg_is_present? args, "--url", "The 'url' setting can only be set in your config files." + no_subcommand(args) end def no_subcommand(args) if args.size > 0 && args.first =~ /^--/ && !%w[--help --version].include?(args.first) - deprecation_message "Jekyll now uses subcommands instead of just \ - switches. Run `jekyll --help` to find out more." + deprecation_message "Jekyll now uses subcommands instead of just switches. Run `jekyll --help` to find out more." + abort end end