We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9856ed0 commit 1a74d8dCopy full SHA for 1a74d8d
src/bin/convert-json-schema.rs
@@ -1,6 +1,22 @@
1
use outlines_core::prelude::*;
2
3
+fn print_help() {
4
+ println!("JSON Schema to Regex Converter\n");
5
+ println!("Usage:");
6
+ println!(" cat schema.json | convert-json-schema");
7
+ println!(" convert-json-schema --help\n");
8
+ println!("Options:");
9
+ println!(" --help Show this help message\n");
10
+ println!("Description:");
11
+ println!(" Reads a JSON Schema from stdin and converts it to a regular expression.");
12
+}
13
+
14
fn main() {
15
+ if std::env::args().any(|arg| arg == "--help") {
16
+ print_help();
17
+ return;
18
+ }
19
20
let schema = std::io::read_to_string(std::io::stdin()).unwrap();
21
let regex = json_schema::regex_from_str(&schema, None).unwrap();
22
println!("Regex: {}", regex);
0 commit comments