From 144778e8e964c753ef698998433f995ccd4b2b13 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Sun, 11 Dec 2022 02:05:53 +0530 Subject: [PATCH] Define CLI option descriptions consistently (#496) Merge pull request 496 --- lib/jekyll-import/importers/blogger.rb | 4 +- lib/jekyll-import/importers/csv.rb | 4 +- lib/jekyll-import/importers/drupal_common.rb | 4 +- lib/jekyll-import/importers/easyblog.rb | 12 +++--- lib/jekyll-import/importers/enki.rb | 8 ++-- lib/jekyll-import/importers/joomla.rb | 14 +++---- lib/jekyll-import/importers/joomla3.rb | 14 +++---- lib/jekyll-import/importers/jrnl.rb | 8 ++-- lib/jekyll-import/importers/marley.rb | 2 +- lib/jekyll-import/importers/mephisto.rb | 2 +- lib/jekyll-import/importers/mt.rb | 18 ++++----- lib/jekyll-import/importers/pluxml.rb | 6 +-- lib/jekyll-import/importers/roller.rb | 22 +++++------ lib/jekyll-import/importers/rss.rb | 10 ++--- lib/jekyll-import/importers/s9y_database.rb | 38 +++++++++---------- lib/jekyll-import/importers/textpattern.rb | 8 ++-- lib/jekyll-import/importers/tumblr.rb | 10 ++--- lib/jekyll-import/importers/typo.rb | 10 ++--- lib/jekyll-import/importers/wordpress.rb | 30 +++++++-------- .../importers/wordpressdotcom.rb | 6 +-- 20 files changed, 115 insertions(+), 115 deletions(-) diff --git a/lib/jekyll-import/importers/blogger.rb b/lib/jekyll-import/importers/blogger.rb index 7bb169b3..29c629c8 100644 --- a/lib/jekyll-import/importers/blogger.rb +++ b/lib/jekyll-import/importers/blogger.rb @@ -5,9 +5,9 @@ module Importers class Blogger < Importer def self.specify_options(c) c.option "source", "--source NAME", "The XML file (blog-MM-DD-YYYY.xml) path to import" - c.option "no-blogger-info", "--no-blogger-info", "not to leave blogger-URL info (id and old URL) in the front matter (default: false)" + c.option "no-blogger-info", "--no-blogger-info", "not to leave blogger-URL info (id and old URL) in the front matter. (default: false)" c.option "replace-internal-link", "--replace-internal-link", "replace internal links using the post_url liquid tag. (default: false)" - c.option "comments", "--comments", "import comments to _comments collection" + c.option "comments", "--comments", "import comments to _comments collection. (default: false)" end def self.validate(options) diff --git a/lib/jekyll-import/importers/csv.rb b/lib/jekyll-import/importers/csv.rb index c6057880..7cce263f 100644 --- a/lib/jekyll-import/importers/csv.rb +++ b/lib/jekyll-import/importers/csv.rb @@ -12,8 +12,8 @@ def self.require_deps end def self.specify_options(c) - c.option "file", "--file NAME", 'The CSV file to import (default: "posts.csv")' - c.option "no-front-matter", "--no-front-matter", "Do not add the default front matter to the post body" + c.option "file", "--file NAME", "The CSV file to import. (default: 'posts.csv')" + c.option "no-front-matter", "--no-front-matter", "Do not add the default front matter to the post body. (default: false)" end # Reads a csv with title, permalink, body, published_at, and filter. diff --git a/lib/jekyll-import/importers/drupal_common.rb b/lib/jekyll-import/importers/drupal_common.rb index 9209d28b..ef9046ca 100644 --- a/lib/jekyll-import/importers/drupal_common.rb +++ b/lib/jekyll-import/importers/drupal_common.rb @@ -23,9 +23,9 @@ module ClassMethods }.freeze def specify_options(c) - c.option "engine", "--engine [mysql|postgresql]", "Database engine (default: #{DEFAULTS["engine"].inspect})" c.option "dbname", "--dbname DB", "Database name" c.option "user", "--user USER", "Database user name" + c.option "engine", "--engine [mysql|postgresql]", "Database engine (default: #{DEFAULTS["engine"].inspect})" c.option "password", "--password PW", "Database user's password (default: #{DEFAULTS["password"].inspect})" c.option "host", "--host HOST", "Database host name (default: #{DEFAULTS["host"].inspect})" c.option "port", "--port PORT", "Database port name (default: #{DEFAULTS["port"].inspect})" @@ -47,9 +47,9 @@ def require_deps end def process(options) - engine = options.fetch("engine", DEFAULTS["engine"]) dbname = options.fetch("dbname") user = options.fetch("user") + engine = options.fetch("engine", DEFAULTS["engine"]) pass = options.fetch("password", DEFAULTS["password"]) host = options.fetch("host", DEFAULTS["host"]) port = options.fetch("port", DEFAULTS["port"]) diff --git a/lib/jekyll-import/importers/easyblog.rb b/lib/jekyll-import/importers/easyblog.rb index 9c27faff..dfa698ca 100644 --- a/lib/jekyll-import/importers/easyblog.rb +++ b/lib/jekyll-import/importers/easyblog.rb @@ -10,12 +10,12 @@ def self.validate(options) end def self.specify_options(c) - c.option "dbname", "--dbname", "Database name" - c.option "user", "--user", "Database user name" - c.option "password", "--password", "Database user's password (default: '')" - c.option "host", "--host", "Database host name" - c.option "section", "--section", "Table prefix name" - c.option "prefix", "--prefix", "Table prefix name" + c.option "dbname", "--dbname", "Database name." + c.option "user", "--user", "Database user name." + c.option "password", "--password", "Database user's password. (default: '')" + c.option "host", "--host", "Database host name. (default: 'localhost')" + c.option "section", "--section", "Section ID. (default: '1')" + c.option "prefix", "--prefix", "Table prefix name. (default: 'jos_')" end def self.require_deps diff --git a/lib/jekyll-import/importers/enki.rb b/lib/jekyll-import/importers/enki.rb index 26147b85..d0cc19f1 100644 --- a/lib/jekyll-import/importers/enki.rb +++ b/lib/jekyll-import/importers/enki.rb @@ -20,10 +20,10 @@ def self.validate(options) end def self.specify_options(c) - c.option "dbname", "--dbname", "Database name" - c.option "user", "--user", "Database name" - c.option "password", "--password", 'Database name (default: "")' - c.option "host", "--host", "Database name" + c.option "dbname", "--dbname", "Database name." + c.option "user", "--user", "User name." + c.option "password", "--password", "Database password. (default: '')" + c.option "host", "--host", "Database host name. (default: 'localhost')" end def self.require_deps diff --git a/lib/jekyll-import/importers/joomla.rb b/lib/jekyll-import/importers/joomla.rb index 9096c0a0..65ce3181 100644 --- a/lib/jekyll-import/importers/joomla.rb +++ b/lib/jekyll-import/importers/joomla.rb @@ -10,13 +10,13 @@ def self.validate(options) end def self.specify_options(c) - c.option "dbname", "--dbname", "Database name" - c.option "user", "--user", "Database user name" - c.option "password", "--password", "Database user's password (default: '')" - c.option "host", "--host", "Database host name" - c.option "port", "--port", "Database port" - c.option "section", "--section", "Table prefix name" - c.option "prefix", "--prefix", "Table prefix name" + c.option "dbname", "--dbname", "Database name." + c.option "user", "--user", "Database user name." + c.option "password", "--password", "Database user's password. (default: '')" + c.option "host", "--host", "Database host name. (default: 'localhost')" + c.option "port", "--port", "Database port. (default: '3306')" + c.option "section", "--section", "Section ID. (default: '1')" + c.option "prefix", "--prefix", "Table prefix name. (default: 'jos_')" end def self.require_deps diff --git a/lib/jekyll-import/importers/joomla3.rb b/lib/jekyll-import/importers/joomla3.rb index 74b40d1f..59d424db 100644 --- a/lib/jekyll-import/importers/joomla3.rb +++ b/lib/jekyll-import/importers/joomla3.rb @@ -10,13 +10,13 @@ def self.validate(options) end def self.specify_options(c) - c.option "dbname", "--dbname", "Database name" - c.option "user", "--user", "Database user name" - c.option "password", "--password", "Database user's password (default: '')" - c.option "host", "--host", "Database host name" - c.option "port", "--port", "Database port" - c.option "category", "--category", "ID of the category" - c.option "prefix", "--prefix", "Table prefix name" + c.option "dbname", "--dbname", "Database name." + c.option "user", "--user", "Database user name." + c.option "password", "--password", "Database user's password. (default: '')" + c.option "host", "--host", "Database host name. (default: 'localhost')" + c.option "port", "--port", "Database port. (default: '3306')" + c.option "category", "--category", "ID of the category. (default: '0')" + c.option "prefix", "--prefix", "Table prefix name. (default: 'jos_')" end def self.require_deps diff --git a/lib/jekyll-import/importers/jrnl.rb b/lib/jekyll-import/importers/jrnl.rb index 16669079..d1dfa21b 100644 --- a/lib/jekyll-import/importers/jrnl.rb +++ b/lib/jekyll-import/importers/jrnl.rb @@ -12,10 +12,10 @@ def self.require_deps end def self.specify_options(c) - c.option "file", "--file FILENAME", 'Journal file (default: "~/journal.txt")' - c.option "time_format", "--time_format FORMAT", 'Time format of your journal (default: "%Y-%m-%d %H:%M")' - c.option "extension", "--extension EXT", 'Output extension (default: "md")' - c.option "layout", "--layout NAME", 'Output post layout (default: "post")' + c.option "file", "--file FILENAME", "Journal file. (default: '~/journal.txt')" + c.option "time_format", "--time_format FORMAT", "Time format of your journal. (default: '%Y-%m-%d %H:%M')" + c.option "extension", "--extension EXT", "Output extension. (default: 'md')" + c.option "layout", "--layout NAME", "Output post layout. (default: 'post')" end # Reads a jrnl file and creates a new post for each entry diff --git a/lib/jekyll-import/importers/marley.rb b/lib/jekyll-import/importers/marley.rb index 23855802..56d30307 100644 --- a/lib/jekyll-import/importers/marley.rb +++ b/lib/jekyll-import/importers/marley.rb @@ -28,7 +28,7 @@ def self.require_deps end def self.specify_options(c) - c.option "marley_data_dir", "--marley_data_dir DIR", "The dir containing your marley data" + c.option "marley_data_dir", "--marley_data_dir DIR", "The dir containing your marley data." end def self.process(options) diff --git a/lib/jekyll-import/importers/mephisto.rb b/lib/jekyll-import/importers/mephisto.rb index 8cd86f52..90cb44bc 100644 --- a/lib/jekyll-import/importers/mephisto.rb +++ b/lib/jekyll-import/importers/mephisto.rb @@ -40,7 +40,7 @@ def self.specify_options(c) c.option "dbname", "--dbname DB", "Database name" c.option "user", "--user USER", "Database user name" c.option "password", "--password PW", "Database user's password (default: '')" - c.option "host", "--host HOST", 'Database host name (default: "localhost")' + c.option "host", "--host HOST", "Database host name (default: 'localhost')" end # This query will pull blog posts from all entries across all blogs. If diff --git a/lib/jekyll-import/importers/mt.rb b/lib/jekyll-import/importers/mt.rb index f53baa52..1764355e 100644 --- a/lib/jekyll-import/importers/mt.rb +++ b/lib/jekyll-import/importers/mt.rb @@ -32,17 +32,17 @@ def self.require_deps end def self.specify_options(c) - c.option "engine", "--engine ENGINE", "Database engine, (default: 'mysql', postgres also supported)" - c.option "dbname", "--dbname DB", "Database name" - c.option "user", "--user USER", "Database user name" - c.option "password", "--password PW", "Database user's password, (default: '')" - c.option "host", "--host HOST", 'Database host name (default: "localhost")' - c.option "port", "--port PORT", "Custom database port connect to (optional)" - c.option "blog_id", "--blog_id ID", "Specify a single Movable Type blog ID to import (default: all blogs)" - c.option "categories", "--categories", "If true, save post's categories in its YAML front matter. (default: true)" + c.option "dbname", "--dbname DB", "Database name." + c.option "user", "--user USER", "Database user name." + c.option "engine", "--engine ENGINE", "Database engine ('mysql' or 'postgres'). (default: 'mysql')" + c.option "password", "--password PW", "Database user's password. (default: '')" + c.option "host", "--host HOST", "Database host name. (default: 'localhost')" + c.option "port", "--port PORT", "Custom database port connect to. (default: null)" + c.option "blog_id", "--blog_id ID", "Specify a single Movable Type blog ID to import. (default: null (all blogs))" + c.option "categories", "--categories", "When true, save post's categories in its YAML front matter. (default: true)" c.option "src_encoding", "--src_encoding ENCODING", "Encoding of strings from database. (default: UTF-8)" c.option "dest_encoding", "--dest_encoding ENCODING", "Encoding of output strings. (default: UTF-8)" - c.option "comments", "--comments", "If true, output comments in _comments directory (default: false)" + c.option "comments", "--comments", "When true, output comments in `_comments` directory. (default: false)" end # By default this migrator will include posts for all your MovableType blogs. diff --git a/lib/jekyll-import/importers/pluxml.rb b/lib/jekyll-import/importers/pluxml.rb index 5f8eaa49..983d87f4 100644 --- a/lib/jekyll-import/importers/pluxml.rb +++ b/lib/jekyll-import/importers/pluxml.rb @@ -12,9 +12,9 @@ def self.require_deps end def self.specify_options(c) - c.option "source", "--source NAME", "The PluXML data directory to import" - c.option "layout", "--layout NAME", "The layout to apply" - c.option "avoid_liquid", "--avoid_liquid true", "Will add render_with_liquid: false in frontmatter" + c.option "source", "--source NAME", "The PluXml data directory to import." + c.option "layout", "--layout NAME", "The layout to apply. (default: 'post')" + c.option "avoid_liquid", "--avoid_liquid", "Will add `render_with_liquid: false` in front matter. (default: false)" end def self.validate(options) diff --git a/lib/jekyll-import/importers/roller.rb b/lib/jekyll-import/importers/roller.rb index 74fc37fe..102b70d7 100644 --- a/lib/jekyll-import/importers/roller.rb +++ b/lib/jekyll-import/importers/roller.rb @@ -14,19 +14,19 @@ def self.require_deps end def self.specify_options(c) - c.option "dbname", "--dbname DB", "Database name (default: '')" - c.option "socket", "--socket SOCKET", "Database socket (default: '')" - c.option "user", "--user USER", "Database user name (default: '')" - c.option "password", "--password PW", "Database user's password (default: '')" - c.option "host", "--host HOST", "Database host name (default: 'localhost')" - c.option "port", "--port PORT", "Database port number (default: '3306')" - c.option "clean_entities", "--clean_entities", "Whether to clean entities (default: true)" - c.option "comments", "--comments", "Whether to import comments (default: true)" - c.option "categories", "--categories", "Whether to import categories (default: true)" - c.option "tags", "--tags", "Whether to import tags (default: true)" + c.option "dbname", "--dbname DB", "Database name." + c.option "user", "--user USER", "Database user name." + c.option "password", "--password PW", "Database user's password." + c.option "socket", "--socket SOCKET", "Database socket. (default: null)" + c.option "host", "--host HOST", "Database host name. (default: 'localhost')" + c.option "port", "--port PORT", "Database port number. (default: '3306')" + c.option "clean_entities", "--clean_entities", "Whether to clean entities. (default: true)" + c.option "comments", "--comments", "Whether to import comments. (default: true)" + c.option "categories", "--categories", "Whether to import categories. (default: true)" + c.option "tags", "--tags", "Whether to import tags. (default: true)" c.option "status", "--status STATUS,STATUS2", Array, - "Array of allowed statuses (default: ['PUBLISHED'], other options: 'DRAFT')" + "Array of allowed statuses (either ['PUBLISHED'] or ['DRAFT']). (default: ['PUBLISHED'])" end # Main migrator function. Call this to perform the migration. diff --git a/lib/jekyll-import/importers/rss.rb b/lib/jekyll-import/importers/rss.rb index 55e63a05..4bb0c532 100644 --- a/lib/jekyll-import/importers/rss.rb +++ b/lib/jekyll-import/importers/rss.rb @@ -4,11 +4,11 @@ module JekyllImport module Importers class RSS < Importer def self.specify_options(c) - c.option "source", "--source NAME", "The RSS file or URL to import" - c.option "tag", "--tag NAME", "Add a specific tag to all posts" - c.option "extract_tags", "--extract_tags KEY", "Copies tags from the given subfield on the RSS " - c.option "render_audio", "--render_audio", "Render