aboutsummaryrefslogtreecommitdiff
path: root/mingling/src/gen_program.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mingling/src/gen_program.rs')
-rw-r--r--mingling/src/gen_program.rs34
1 files changed, 18 insertions, 16 deletions
diff --git a/mingling/src/gen_program.rs b/mingling/src/gen_program.rs
index 6a0b144..ed60668 100644
--- a/mingling/src/gen_program.rs
+++ b/mingling/src/gen_program.rs
@@ -4,7 +4,6 @@
use mingling_core::ChainProcess;
use mingling_core::Dispatcher;
use mingling_core::Grouped;
-use mingling_core::Node;
use mingling_core::Program;
use mingling_core::ProgramCollect;
@@ -13,7 +12,7 @@ pub type Next = ChainProcess<ThisProgram>;
/// The generic program entry point.
///
-/// This type is created by the `pack!` macro as a variant of the
+/// This type is generated by the `gen_program!` macro as a variant of the
/// program's output type set (`ThisProgram`).
pub struct Entry {
/// The arguments provided by the user
@@ -42,7 +41,7 @@ pub enum ThisProgram {
/// A struct representing a "renderer not found" error.
///
-/// This type is created by the `pack!` macro as a variant of the
+/// This type is generated by the `gen_program!` macro as a variant of the
/// program's output type set (`ThisProgram`).
pub struct ErrorRendererNotFound {
/// The name of the renderer that was not found
@@ -51,7 +50,7 @@ pub struct ErrorRendererNotFound {
/// A struct representing a "dispatcher not found" error.
///
-/// This type is created by the `pack!` macro as a variant of the
+/// This type is generated by the `gen_program!` macro as a variant of the
/// program's output type set (`ThisProgram`).
pub struct EntryFallback {
/// The arguments provided by the user
@@ -62,8 +61,6 @@ pub struct EntryFallback {
pub struct ResultEmpty;
/// A dispatcher representing the subcommand `__comp` itself.
-///
-/// **You can register it using `with_dispatcher`.**
#[cfg(feature = "comp")]
pub struct CMDCompletion;
@@ -72,7 +69,7 @@ pub struct CMDCompletion;
/// This struct holds the raw command-line arguments that were passed to the `__comp`
/// subcommand, which will be used to compute completion suggestions.
///
-/// This type is created by the `pack!` macro as a variant of the
+/// This type is generated by the `gen_program!` macro as a variant of the
/// program's output type set (`ThisProgram`).
#[cfg(feature = "comp")]
pub struct CompletionContext {
@@ -86,7 +83,7 @@ pub struct CompletionContext {
/// which together provide the information needed to render completion candidates
/// to the user's shell.
///
-/// This type is created by the `pack!` macro as a variant of the
+/// This type is generated by the `gen_program!` macro as a variant of the
/// program's output type set (`ThisProgram`).
#[cfg(feature = "comp")]
pub struct CompletionSuggest {
@@ -96,18 +93,10 @@ pub struct CompletionSuggest {
#[cfg(feature = "comp")]
impl Dispatcher<ThisProgram> for CMDCompletion {
- fn node(&self) -> mingling_core::Node {
- Node::default().join(mingling_core::COMPLETION_SUBCOMMAND)
- }
-
fn begin(&self, args: Vec<String>) -> ChainProcess<ThisProgram> {
use mingling_core::AnyOutput;
AnyOutput::new(CompletionContext { inner: args }).route_chain()
}
-
- fn clone_dispatcher(&self) -> Box<dyn Dispatcher<ThisProgram>> {
- todo!()
- }
}
// SAFETY: These implementations are provided for demonstration purposes only.
@@ -193,6 +182,19 @@ impl ProgramCollect for ThisProgram {
type ResultEmpty = ResultEmpty;
+ fn dispatch_args(
+ _raw: &[String],
+ ) -> Result<
+ mingling_core::AnyOutput<Self::Enum>,
+ mingling_core::error::ProgramInternalExecuteError,
+ > {
+ todo!()
+ }
+
+ fn get_nodes() -> Vec<(String, &'static (dyn Dispatcher<Self::Enum> + Send + Sync))> {
+ todo!()
+ }
+
fn build_renderer_not_found(_member_id: Self::Enum) -> mingling_core::AnyOutput<Self::Enum> {
todo!()
}