File tree 2 files changed +22
-0
lines changed
clap_complete/src/dynamic 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 5
5
//!
6
6
//! To source your completions:
7
7
//!
8
+ //! **WARNING:** We recommend re-sourcing your completions on upgrade.
9
+ //! These completions work by generating shell code that calls into `your_program` while completing.
10
+ //! That interface is unstable and a mismatch between the shell code and `your_program` may result
11
+ //! in either invalid completions or no completions being generated.
12
+ //! For this reason, we recommend generating the shell code anew on shell startup so that it is
13
+ //! "self-correcting" on shell launch, rather than writing the generated completions to a file.
14
+ //!
8
15
//! Bash
9
16
//! ```bash
10
17
//! echo "source <(your_program complete bash)" >> ~/.bashrc
@@ -207,6 +214,10 @@ pub trait CommandCompleter {
207
214
///
208
215
/// Write the `buf` the logic needed for calling into `<cmd> complete`, passing needed
209
216
/// arguments to [`CommandCompleter::write_complete`] through the environment.
217
+ ///
218
+ /// **WARNING:** There are no stability guarantees between the call to
219
+ /// [`CommandCompleter::write_complete`] that this generates and actually calling [`CommandCompleter::write_complete`].
220
+ /// Caching the results of this call may result in invalid or no completions to be generated.
210
221
fn write_registration (
211
222
& self ,
212
223
name : & str ,
Original file line number Diff line number Diff line change 18
18
//!
19
19
//! To source your completions:
20
20
//!
21
+ //! **WARNING:** We recommend re-sourcing your completions on upgrade.
22
+ //! These completions work by generating shell code that calls into `your_program` while completing.
23
+ //! That interface is unstable and a mismatch between the shell code and `your_program` may result
24
+ //! in either invalid completions or no completions being generated.
25
+ //! For this reason, we recommend generating the shell code anew on shell startup so that it is
26
+ //! "self-correcting" on shell launch, rather than writing the generated completions to a file.
27
+ //!
21
28
//! Bash
22
29
//! ```bash
23
30
//! echo "source <(COMPLETE=bash your_program)" >> ~/.bashrc
@@ -276,6 +283,10 @@ pub trait EnvCompleter {
276
283
///
277
284
/// Write the `buf` the logic needed for calling into `<VAR>=<shell> <cmd> --`, passing needed
278
285
/// arguments to [`EnvCompleter::write_complete`] through the environment.
286
+ ///
287
+ /// **WARNING:** There are no stability guarantees between the call to
288
+ /// [`EnvCompleter::write_complete`] that this generates and actually calling [`EnvCompleter::write_complete`].
289
+ /// Caching the results of this call may result in invalid or no completions to be generated.
279
290
fn write_registration (
280
291
& self ,
281
292
var : & str ,
You can’t perform that action at this time.
0 commit comments