Skip to content
Discussion options

You must be logged in to vote

I still curious in which cases cmd might have an invalid state? If it's incorrect usage, why not to return Result<> or even panic?

We are ensuring the following has been run:

  • /// Prepare for introspecting on all included [`Command`]s
    ///
    /// Call this on the top-level [`Command`] when done building and before reading state for
    /// cases like completions, custom help output, etc.
    pub fn build(&mut self) {
    self._build_recursive(true);
    self._build_bin_names_internal();
    }
    pub(crate) fn _build_recursive(&mut self, expand_help_tree: bool) {
    self._build_self(e…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@eirnym
Comment options

@epage
Comment options

epage Sep 9, 2025
Maintainer

@eirnym
Comment options

@epage
Comment options

Answer selected by eirnym
@eirnym
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants