aboutsummaryrefslogtreecommitdiff
path: root/mingling/src/example_docs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mingling/src/example_docs.rs')
-rw-r--r--mingling/src/example_docs.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/mingling/src/example_docs.rs b/mingling/src/example_docs.rs
index 2e3f689..79a0626 100644
--- a/mingling/src/example_docs.rs
+++ b/mingling/src/example_docs.rs
@@ -119,20 +119,21 @@ pub mod example_basic {}
///
/// #[completion(FruitEntry)]
/// fn comp_fruit_command(ctx: &ShellContext) -> Suggest {
-/// if ctx.current_word.starts_with("-") {
-/// return suggest! {
-/// "--name": "Fruit name",
-/// "--type": "Fruit type"
-/// };
-/// }
-/// if ctx.previous_word == "--name" {
+/// if ctx.filling_argument_first("--name") {
/// return suggest!();
/// }
-/// if ctx.previous_word == "--type" {
+/// if ctx.filling_argument_first("--type") {
/// return suggest! {
/// "apple", "banana"
/// };
/// }
+/// if ctx.typing_argument() {
+/// return suggest! {
+/// "--name": "Fruit name",
+/// "--type": "Fruit type"
+/// }
+/// .strip_typed_argument(ctx);
+/// }
/// return suggest!();
/// }
///