Recursively return subcommands in `command_view`

finchie
Nov 28, 2023, 1:05 PM
DZIP6GYYVEBCMAVYZBB6AHNQCXPA3QMWLLVB6FVDKEE7XDFMK7WAC

Dependencies

  • [2] 6FCEG2XL Refactor argument documentation into generic function
  • [3] JFJVY57R List `clap` argument IDs
  • [4] C73UJ7ZY Create simple `xilem_html` demo
  • [5] SM7AIPUZ Create `command` module

Change contents

  • replacement in src/main.rs at line 51
    [3.250][3.250:735]()
    el::div((
    command_view(&state.command, arg_matches),
    state
    .command
    .get_subcommands()
    .map(|subcommand| {
    command_view(
    subcommand,
    arg_matches.and_then(|arg_matches| {
    arg_matches.subcommand_matches(subcommand.get_name())
    }),
    )
    })
    .collect::<Vec<_>>(),
    ))
    .attr("id", "sidebar")
    [3.250]
    [3.735]
    el::div(command_view(&state.command, arg_matches)).attr("id", "sidebar")
  • replacement in src/command.rs at line 3
    [2.1799][2.1799:1847]()
    use xilem_html::{elements as el, ViewSequence};
    [2.1799]
    [2.1847]
    use xilem_html::{elements as el, AnyView, View, ViewMarker, ViewSequence};
  • replacement in src/command.rs at line 21
    [2.2299][2.2299:2352]()
    ) -> impl ViewSequence<AppState> {
    el::section((
    [2.2299]
    [2.2352]
    ) -> Box<dyn AnyView<AppState>> {
    Box::new(el::section((
  • replacement in src/command.rs at line 26
    [2.2539][2.2539:2546]()
    ))
    [2.2539]
    [2.2546]
    command
    .get_subcommands()
    .map(|subcmd| {
    command_view(
    subcmd,
    arg_matches
    .and_then(|arg_matches| arg_matches.subcommand_matches(subcmd.get_name())),
    )
    })
    .collect::<Vec<_>>(),
    )))