summaryrefslogtreecommitdiff
path: root/src/entry.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/entry.rs')
-rw-r--r--src/entry.rs50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/entry.rs b/src/entry.rs
deleted file mode 100644
index f1d5203..0000000
--- a/src/entry.rs
+++ /dev/null
@@ -1,50 +0,0 @@
-use std::process::exit;
-
-use crate::chunker::{
- context::ButckContext,
- rw::{self, error::ButckRWError},
-};
-
-pub async fn entry(ctx: ButckContext, args: Vec<String>) -> Result<(), ButckRWError> {
- if let Some(subcommand) = args.first() {
- return match subcommand.as_str() {
- "write" => rw::storage::write(ctx).await,
- "build" => rw::storage::build(ctx).await,
- "lspolicy" => {
- if ctx.stream_read.is_some() {
- butck_policies::stream_policies()
- .iter()
- .for_each(|p| println!("{}", p));
- } else {
- butck_policies::policies()
- .iter()
- .for_each(|p| println!("{}", p));
- }
- return Ok(());
- }
- "lspolicy-all" => {
- let policies = butck_policies::policies();
- let stream_policies = butck_policies::stream_policies();
- let mut all_policies: Vec<_> =
- policies.iter().chain(stream_policies.iter()).collect();
- all_policies.sort();
- all_policies.dedup();
- all_policies.iter().for_each(|p| println!("{}", p));
- return Ok(());
- }
- _ => {
- print_help();
- exit(1)
- }
- };
- }
- Ok(())
-}
-
-pub fn print_help() {
- println!("{}", include_str!("../resources/helps/butck.txt").trim());
-}
-
-pub fn print_version() {
- println!("{}", include_str!("../resources/version_info.txt").trim());
-}