worm_hole 4.2.0

CLI tool to easily jump between directories
// Copyright (C) 2026 Rignchen
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.
use clap::Parser;

mod add;
mod edit;
mod init;
pub mod list;
mod query;
mod remove;
mod rename;
mod search;

pub use add::AddAlias;
pub use edit::EditAlias;
pub use init::Init;
pub use list::ListAliases;
pub use query::Query;
pub use remove::RemoveAlias;
pub use rename::RenameAlias;
pub use search::SearchAliases;

#[derive(Parser, Debug)]
pub enum Command {
	/// Get the path for the given alias
	Query(Query),
	/// Add an alias-path pair
	#[clap(name = "add")]
	AddAlias(AddAlias),
	/// Remove an alias-path pair
	#[clap(name = "rm")]
	RemoveAlias(RemoveAlias),
	/// List all alias-path pairs
	#[clap(name = "ls")]
	ListAliases(ListAliases),
	/// Search for the aliases which have a path maching the given pattern
	#[clap(name = "search")]
	SearchAliases(SearchAliases),
	/// Edit the path of an alias
	#[clap(name = "edit")]
	EditAlias(EditAlias),
	/// Change an alias without changing the path
	#[clap(name = "rename")]
	RenameAlias(RenameAlias),
	/// Initialize the database and the config to make wormhole work
	Init(Init),
}