diff --git a/custom-completions/rustup/rustup-completions.nu b/custom-completions/rustup/rustup-completions.nu index cb1078696..e1b1acadd 100644 --- a/custom-completions/rustup/rustup-completions.nu +++ b/custom-completions/rustup/rustup-completions.nu @@ -2,17 +2,17 @@ def "nu-complete rustup" [] { ^rustup --help - | str replace --regex --multiline '(rustup[\s\S]*(?=Commands:))' '' - | str replace --regex --multiline '\n+Arguments:[\s\S]*' '' + | str replace --regex --multiline '(rustup[\s\S]*(?=SUBCOMMANDS:))' '' + | str replace --regex --multiline '\n+DISCUSSION:[\s\S]*' '' | lines | where $it starts-with " " | parse -r '\s*(?P[^ ]+) \s*(?P\w.*)' } def "nu-complete rustup toolchain" [] { - ^rustup toolchain - | str replace --regex --multiline '(rustup[\s\S]*(?=Commands:))' '' - | str replace --regex --multiline '\n+Options:[\s\S]*' '' + ^rustup toolchain --help + | str replace --regex --multiline '(rustup[\s\S]*(?=SUBCOMMANDS:))' '' + | str replace --regex --multiline '\n+DISCUSSION:[\s\S]*' '' | lines | where $it starts-with " " | parse -r '\s*(?P[^ ]+) \s*(?P\w.*)' @@ -34,9 +34,9 @@ def "nu-complete rustup toolchain list" [] { } def "nu-complete rustup target" [] { - ^rustup target - | str replace --regex --multiline '(rustup[\s\S]*(?=Commands:))' '' - | str replace --regex --multiline '\n+Options:[\s\S]*' '' + ^rustup target --help + | str replace --regex --multiline '(rustup[\s\S]*(?=SUBCOMMANDS:))' '' + | str replace --regex --multiline '\n+DISCUSSION:[\s\S]*' '' | lines | where $it starts-with " " | parse -r '\s*(?P[^ ]+) \s*(?P\w.*)' @@ -68,9 +68,9 @@ def "nu-complete rustup update" [] { } def "nu-complete rustup component" [] { - ^rustup component - | str replace --regex --multiline '(rustup[\s\S]*(?=Commands:))' '' - | str replace --regex --multiline '\n+Options:[\s\S]*' '' + ^rustup component --help + | str replace --regex --multiline '(rustup[\s\S]*(?=SUBCOMMANDS:))' '' + | str replace --regex --multiline '\n+DISCUSSION:[\s\S]*' '' | lines | where $it starts-with " " | parse -r '\s*(?P[^ ]+) \s*(?P\w.*)' @@ -93,9 +93,9 @@ def "nu-complete rustup component list installed" [] { } def "nu-complete rustup override" [] { - ^rustup override - | str replace --regex --multiline '(rustup[\s\S]*(?=Commands:))' '' - | str replace --regex --multiline '\n+Options:[\s\S]*' '' + ^rustup override --help + | str replace --regex --multiline '(rustup[\s\S]*(?=SUBCOMMANDS:))' '' + | str replace --regex --multiline '\n+DISCUSSION:[\s\S]*' '' | lines | where $it starts-with " " | parse -r '\s*(?P[^ ]+) \s*(?P\w.*)' @@ -116,18 +116,17 @@ def "nu-complete rustup override list installed" [] { } def "nu-complete rustup self" [] { - ^rustup self - | str replace --regex --multiline '(rustup[\s\S]*(?=Commands:))' '' - | str replace --regex --multiline '\n+Options:[\s\S]*' '' + ^rustup self --help + | str replace --regex --multiline '(rustup[\s\S]*(?=SUBCOMMANDS:))' '' | lines | where $it starts-with " " | parse -r '\s*(?P[^ ]+) \s*(?P\w.*)' } def "nu-complete rustup set" [] { - ^rustup set - | str replace --regex --multiline '(rustup[\s\S]*(?=Commands:))' '' - | str replace --regex --multiline '\n+Options:[\s\S]*' '' + ^rustup set --help + | str replace --regex --multiline '(rustup[\s\S]*(?=SUBCOMMANDS:))' '' + | str replace --regex --multiline '\n+DISCUSSION:[\s\S]*' '' | lines | where $it starts-with " " | parse -r '\s*(?P[^ ]+) \s*(?P\w.*)'