pagecord-cli 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e6a9d37234707507835ff1e87b324bccfacc7d680515b9674f0f0fa454cd704
4
- data.tar.gz: d0628c7e0c4e1273cb24a870f9db83e9ec25da7f01395eae3503f4aa1900f130
3
+ metadata.gz: 282d0f9f75b00c70f396dd00494c60b0e345d8af90689fa6cd6f217ea2288c12
4
+ data.tar.gz: db5c120d320ed5c012c4576e7fce832879336e3b3e255ce0b494ff0ddb489e73
5
5
  SHA512:
6
- metadata.gz: 300fd7fe1c31e8ab0196b8a8c0d8509819ec2d0882ea3bbbc98a4c34d4aaac22d05325a4197b4fcd5f1ff79480566c7d764acbd1ee173926e31c004f4b91b510
7
- data.tar.gz: d016d8f89cf2150b0a25872543603e19fdf87322ec5a9206c3aa532bf50de98f916df3a83de59c9815d530287ffcddae9236b9f4195ee8ad0c3fb3839b2dede6
6
+ metadata.gz: 1b8f2174e7ca61cdba14e6b1accdd617da6c71c1b747c379120c6ff13955d1de26b0256ea34fecb2908e128a19eab52785abd0d2ae2d868916ac129f16d0523a
7
+ data.tar.gz: 872259af41ebbf97ece3a9eb859ebf4509f97568cd8027d8b5d6f813d40c5d96562ee7de51ead2e133922a64c26d2c3f0c7f7ba1896e765de969e9ee01d88f67
@@ -34,6 +34,7 @@ module PagecordCLI
34
34
 
35
35
  def run
36
36
  return help if argv.empty? || %w[help -h --help].include?(argv.first)
37
+ return version if %w[version -v --version].include?(argv.first)
37
38
 
38
39
  parser.order!(argv)
39
40
  command = argv.shift
@@ -316,7 +317,7 @@ module PagecordCLI
316
317
  opts.on("--published-at TIME") { |value| overrides[:published_at] = value }
317
318
  opts.on("--tags TAGS") { |value| overrides[:tags] = value }
318
319
  opts.on("--canonical-url URL") { |value| overrides[:canonical_url] = value }
319
- opts.on("--hidden") { overrides[:hidden] = true }
320
+ opts.on("--[no-]hidden") { |value| overrides[:hidden] = value }
320
321
  opts.on("--locale LOCALE") { |value| overrides[:locale] = value }
321
322
  end.parse!(argv)
322
323
 
@@ -412,9 +413,16 @@ module PagecordCLI
412
413
  end
413
414
  end
414
415
 
416
+ def version
417
+ options[:json] = argv.include?("--json")
418
+ options[:json] ? print_json({ version: VERSION }) : output.puts("pagecord #{VERSION}")
419
+ 0
420
+ end
421
+
415
422
  def help
416
423
  output.puts <<~HELP
417
424
  Usage:
425
+ pagecord version
418
426
  pagecord login SUBDOMAIN
419
427
  pagecord logout [SUBDOMAIN]
420
428
  pagecord blog list
@@ -437,21 +445,16 @@ module PagecordCLI
437
445
  --json machine-readable output
438
446
  --quiet suppress confirmation messages
439
447
 
440
- Publish options:
448
+ Post options (publish, draft, post and page):
441
449
  --title TITLE
442
450
  --slug SLUG
443
451
  --published-at TIME
444
452
  --tags TAGS
445
453
  --canonical-url URL
446
- --hidden
447
454
  --locale LOCALE
448
-
449
- Post and page options:
450
- --title TITLE
451
- --content-file PATH (HTML, or Markdown if it ends .md)
452
- --status draft|published
453
- --slug, --published-at, --tags, --canonical-url, --locale
454
455
  --hidden, --no-hidden
456
+ --content-file PATH post/page create and update; Markdown if it ends .md
457
+ --status draft|published post/page create and update
455
458
 
456
459
  Appearance options:
457
460
  --theme, --font, --width, --layout
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PagecordCLI
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagecord-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olly Headey
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  requirements: []
49
- rubygems_version: 4.0.16
49
+ rubygems_version: 4.0.20
50
50
  specification_version: 4
51
51
  summary: Publish local files to Pagecord
52
52
  test_files: []