summaryrefslogtreecommitdiff
path: root/cli/args/flags.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-06-14 18:29:19 -0400
committerGitHub <noreply@github.com>2023-06-14 22:29:19 +0000
commit84c793275b324c262dde02a432462565584c83f7 (patch)
treea5995a842fabb37b2ecdab794dbbce76b530ac3a /cli/args/flags.rs
parent48c6f7178703d448da229a5baf19efb403416da0 (diff)
fix: reload config files on watcher restarts (#19487)
Closes #19468
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r--cli/args/flags.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs
index 837bfe315..bae105915 100644
--- a/cli/args/flags.rs
+++ b/cli/args/flags.rs
@@ -117,6 +117,13 @@ pub struct FmtFlags {
pub no_semicolons: Option<bool>,
}
+impl FmtFlags {
+ pub fn is_stdin(&self) -> bool {
+ let args = &self.files.include;
+ args.len() == 1 && args[0].to_string_lossy() == "-"
+ }
+}
+
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct InitFlags {
pub dir: Option<String>,
@@ -154,6 +161,13 @@ pub struct LintFlags {
pub compact: bool,
}
+impl LintFlags {
+ pub fn is_stdin(&self) -> bool {
+ let args = &self.files.include;
+ args.len() == 1 && args[0].to_string_lossy() == "-"
+ }
+}
+
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct ReplFlags {
pub eval_files: Option<Vec<String>>,