Skip to content

Commit 143c835

Browse files
authored
fix(cmd): remove any in command line option (#113)
1 parent 0e97a64 commit 143c835

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use live_reload::FileWatcher;
2020

2121
use crate::cmd::CommandArgs;
2222
use crate::config::Config;
23-
use crate::parse::SyntaxToken;
23+
use crate::parse::{ContentType, SyntaxToken};
2424
use crate::tree::Tree;
2525
use crate::ui::{App, HeaderContext};
2626

@@ -77,6 +77,9 @@ fn run() -> Result<()> {
7777
};
7878

7979
if let Some(target_type) = args.to {
80+
if matches!(target_type, ContentType::Any) {
81+
bail!("target content type cannot be 'any' when using '--to' option");
82+
}
8083
let parser = content_type.new_parser();
8184
let target_parser = target_type.new_parser();
8285

src/parse/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ pub enum ContentType {
2525
Hcl,
2626

2727
/// Useful for some logs file: <https://jsonlines.org/>
28-
Jsonl,
2928
// TODO: check out json-seq as specified in RFC7464 (https://datatracker.ietf.org/doc/html/rfc7464)?
3029
// basically jsonl but every json object is prefixed with 0x1e
30+
Jsonl,
31+
32+
#[clap(skip)]
3133
Any,
3234
}
3335

0 commit comments

Comments
 (0)