Skip to content

Commit 6676107

Browse files
committed
Fix boolean options to work with --no- variants.
1 parent 0bcb3e9 commit 6676107

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

lib/json/ld/writer.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ def self.options
7676
symbol: :compactArrays,
7777
datatype: TrueClass,
7878
control: :checkbox,
79-
on: ["--compact-arrays"],
80-
description: "Replaces arrays with just one element with that element during compaction.") {true},
79+
on: ["--[no-]compact-arrays"],
80+
description: "Replaces arrays with just one element with that element during compaction. Default is `true` use --no-compact-arrays to disable.") {|arg| arg},
8181
RDF::CLI::Option.new(
8282
symbol: :compactToRelative,
8383
datatype: TrueClass,
8484
control: :checkbox,
85-
on: ["--compact-to-relative"],
86-
description: "Creates document relative IRIs when compacting, if `true`, otherwise leaves expanded. Default is `true` use --no-compact-to-relative to disable.") {true},
85+
on: ["--[no-]compact-to-relative"],
86+
description: "Creates document relative IRIs when compacting, if `true`, otherwise leaves expanded. Default is `true` use --no-compact-to-relative to disable.") {|arg| arg},
8787
RDF::CLI::Option.new(
8888
symbol: :context,
8989
datatype: RDF::URI,
@@ -100,14 +100,14 @@ def self.options
100100
symbol: :explicit,
101101
datatype: TrueClass,
102102
control: :checkbox,
103-
on: ["--explicit"],
104-
description: "Only include explicitly declared properties in output (false)") {|arg| RDF::URI(arg)},
103+
on: ["--[no-]explicit"],
104+
description: "Only include explicitly declared properties in output (false)") {|arg| arg},
105105
RDF::CLI::Option.new(
106106
symbol: :omitDefault,
107107
datatype: TrueClass,
108108
control: :checkbox,
109-
on: ["--omitDefault"],
110-
description: "Omit missing properties from output (false)") {|arg| RDF::URI(arg)},
109+
on: ["--[no-]omitDefault"],
110+
description: "Omit missing properties from output (false)") {|arg| arg},
111111
RDF::CLI::Option.new(
112112
symbol: :processing_mode,
113113
datatype: %w(json-ld-1.0 json-ld-1.1),
@@ -118,20 +118,20 @@ def self.options
118118
symbol: :requireAll,
119119
datatype: TrueClass,
120120
control: :checkbox,
121-
on: ["--requireAll"],
122-
description: "Require all properties to match (true)") {|arg| RDF::URI(arg)},
121+
on: ["--[no-]requireAll"],
122+
description: "Require all properties to match (true). Default is `true` use --no-compact-to-relative to disable.") {|arg| arg},
123123
RDF::CLI::Option.new(
124124
symbol: :stream,
125125
datatype: TrueClass,
126126
control: :checkbox,
127-
on: ["--stream"],
128-
description: "Do not attempt to optimize graph presentation, suitable for streaming large graphs.") {true},
127+
on: ["--[no-]stream"],
128+
description: "Do not attempt to optimize graph presentation, suitable for streaming large graphs.") {|arg| arg},
129129
RDF::CLI::Option.new(
130130
symbol: :useRdfType,
131131
datatype: TrueClass,
132132
control: :checkbox,
133-
on: ["--use-rdf-type"],
134-
description: "Treat `rdf:type` like a normal property instead of using `@type`.") {true},
133+
on: ["--[no-]use-rdf-type"],
134+
description: "Treat `rdf:type` like a normal property instead of using `@type`.") {|arg| arg},
135135
]
136136
end
137137

0 commit comments

Comments
 (0)