mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Checking the arguments to ensure we have a subcommand before proceeding. (#1008)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
module Jekyll
|
||||
class Deprecator
|
||||
def self.process(args)
|
||||
no_subcommand(args)
|
||||
deprecation_message args, "--server", "The --server command has been replaced by the \
|
||||
'serve' subcommand."
|
||||
deprecation_message args, "--no-server", "To build Jekyll without launching a server, \
|
||||
@@ -15,6 +16,14 @@ module Jekyll
|
||||
deprecation_message args, "--url", "The 'url' setting can only be set in your config files."
|
||||
end
|
||||
|
||||
def self.no_subcommand(args)
|
||||
if args.size == 0 || args.first =~ /^--/
|
||||
Jekyll::Logger.error "Deprecation:", "Jekyll now uses subcommands instead of just \
|
||||
switches. Run `jekyll help' to find out more."
|
||||
exit(1)
|
||||
end
|
||||
end
|
||||
|
||||
def self.deprecation_message(args, deprecated_argument, message)
|
||||
if args.include?(deprecated_argument)
|
||||
Jekyll::Logger.error "Deprecation:", message
|
||||
|
||||
Reference in New Issue
Block a user