summaryrefslogtreecommitdiff
path: root/cli/args
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-05-01 08:59:38 -0400
committerGitHub <noreply@github.com>2023-05-01 08:59:38 -0400
commit94a148cdb6f7660518c75a3c20109bf64848f0f1 (patch)
tree65e7dbc195090fdbe74bfd3fb5e0ff9231d7a448 /cli/args
parent89160e7cd8647fdf2ebaec45259775be89aa69c7 (diff)
refactor(cli): use CliMainWorker in standalone (#18880)
Uses `CliMainWorker` in all the cli code.
Diffstat (limited to 'cli/args')
-rw-r--r--cli/args/mod.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs
index 440403f62..4038fb099 100644
--- a/cli/args/mod.rs
+++ b/cli/args/mod.rs
@@ -1202,6 +1202,11 @@ impl StorageKeyResolver {
})
}
+ /// Creates a storage key resolver that will always resolve to being empty.
+ pub fn empty() -> Self {
+ Self(Some(None))
+ }
+
/// Resolves the storage key to use based on the current flags, config, or main module.
pub fn resolve_storage_key(
&self,
@@ -1397,5 +1402,9 @@ mod test {
resolver.resolve_storage_key(&specifier),
Some("value".to_string())
);
+
+ // test empty
+ let resolver = StorageKeyResolver::empty();
+ assert_eq!(resolver.resolve_storage_key(&specifier), None);
}
}