nushell: update to version 0.64.0 parser changed slightly, in maybe buggy ways. reported issues and worked around the changes
9d806f8f149eb75c7046d8f90d845e8b2c9c0556
Oliver Krylow <o.krylow@isp-insoft.de> ·
unsigned
- Parent 1: d230c9b4135d
bugabingas dorkfiles
9d806f8f149eb75c7046d8f90d845e8b2c9c0556
Oliver Krylow <o.krylow@isp-insoft.de> ·
unsigned
+231 / −177 text lines
new file mode 100644+135 / −0 text lines
def "complete svn subcommands" [] { ^svn help | lines | skip until { | line | $line | str starts-with "Available subcommands:" } | skip 1 | each { |line| $line | str trim } | take until { |line| $line | empty? } | split column " " | get column1}# TODO: parse xml outputdef "complete svn add paths" [] { ^svn status --depth files | lines | parse "{mode} {file}" | str trim | where mode == ? | get file}def "complete svn revert paths" [] { ^svn status --depth files | lines | parse "{mode} {file}" | where mode == M | str trim | get file}def "complete svn depth" [] { ['empty', 'files', 'immediates', 'infinity'] }def "complete svn changelists" [] { ^svn status --depth files | lines | parse "--- Changelist '{changelist}':" | get --ignore-errors changelist}# Subversion is a tool for version control.# For additional information, see http://subversion.apache.org/export extern svn [ subcommand?: string@"complete svn subcommands" # for help on a specific subcommand. --version # to see the program version and RA modules --quiet # to see just the version number --verbose # to see dependency versions as well]# help (?, h): Describe the usage of this program or its subcommands.# usage: help [SUBCOMMAND...]export extern "svn help" [ subcommand?: string@"complete svn subcommands" # for help on a specific subcommand. --verbose(-v) # also show experimental subcommands and options]# FIXME:# SVN has short options with double dashes: --changelist(--cl).# This is not allowed in nu.# FIXME:# Multiline doccomments will be rendered without the newlines.# Print the status of working copy files and directories.export extern "svn status" [ ...paths: path # PATHs --show-updates(-u) # display update information --verbose(-v) # print extra information --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity') --revision(-r): string # ARG (some commands also take ARG1:ARG2 range) # A revision argument can be one of: # NUMBER revision number # '{' DATE '}' revision at start of the date # 'HEAD' latest in repository # 'BASE' base rev of item's working copy # 'COMMITTED' last commit at or before BASE # 'PREV' revision just before COMMITTED --quiet(-q) # don't print unversioned items --no-ignore # disregard default and svn:ignore and svn:global-ignores property ignores --incremental # give output suitable for concatenation --xml # output in XML --ignore-externals # ignore externals definitions --changelist:string@"complete svn changelists" # operate only on members of changelist ARG]# FIXME: https://github.com/nushell/nushell/issues/5012# rest parameters do not play well with completions yet# the `paths` parameter should be `...paths`# Put new files and directories under version control.export extern "svn add" [ paths: path@"complete svn add paths" # unversioned PATHs for addition --targets: path # pass contents of file ARG as additional args --non-recursive(-N) # obsolete; same as --depth=empty --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity') --quiet(-q) # print nothing, or only summary information --force # ignore already versioned paths --no-ignore # disregard default and svn:ignore and svn:global-ignores property ignores --auto-props # enable automatic properties --no-auto-props # disable automatic properties --parents # add intermediate parents]# Restore pristine working copy state (undo local changes).export extern "svn revert" [ paths: path@"complete svn revert paths" --targets: path # pass contents of file as additional args --recursive(-R) # descend recursively, same as --depth=infinity --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity') --quiet(-q) # print nothing, or only summary information --changelist: string@"complete svn changelists" # operate only on members of changelist ARG --remove-added # reverting an added item will remove it from disk]# FIXME# SVN uses aliases for subcommands. E.g. `co` for `checkout`.# How to express that with nu extern commands?# Check out a working copy from a repository.export extern "svn checkout" [ ...url_with_rev:string # source path: path # destination --revision(-r) # ARG (some commands also take ARG1:ARG2 range) # A revision argument can be one of: # NUMBER revision number # '{' DATE '}' revision at start of the date # 'HEAD' latest in repository # 'BASE' base rev of item's working copy # 'COMMITTED' last commit at or before BASE # 'PREV' revision just before COMMITTED --quiet(-q) # print nothing, or only summary information --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity') --force # force operation to run --ignore-externals # ignore externals definitions]No final newlinedeleted file mode 100644+0 / −135 text lines
def "complete svn subcommands" [] { ^svn help | lines | skip until { | line | $line | str starts-with "Available subcommands:" } | skip 1 | each { |line| $line | str trim } | take until { |line| $line | empty? } | split column " " | get column1}# TODO: parse xml outputdef "complete svn add paths" [] { ^svn status --depth files | lines | parse "{mode} {file}" | str trim | where mode == ? | get file}def "complete svn revert paths" [] { ^svn status --depth files | lines | parse "{mode} {file}" | where mode == M | str trim | get file}def "complete svn depth" [] { ['empty', 'files', 'immediates', 'infinity'] }def "complete svn changelists" [] { ^svn status --depth files | lines | parse "--- Changelist '{changelist}':" | get --ignore-errors changelist}# Subversion is a tool for version control.# For additional information, see http://subversion.apache.org/export extern svn [ subcommand?: string@"complete svn subcommands" # for help on a specific subcommand. --version # to see the program version and RA modules --quiet # to see just the version number --verbose # to see dependency versions as well]# help (?, h): Describe the usage of this program or its subcommands.# usage: help [SUBCOMMAND...]export extern "svn help" [ subcommand?: string@"complete svn subcommands" # for help on a specific subcommand. --verbose(-v) # also show experimental subcommands and options]# FIXME:# SVN has short options with double dashes: --changelist(--cl).# This is not allowed in nu.# FIXME:# Multiline doccomments will be rendered without the newlines.# Print the status of working copy files and directories.export extern "svn status" [ ...paths: path # PATHs --show-updates(-u) # display update information --verbose(-v) # print extra information --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity') --revision(-r): string # ARG (some commands also take ARG1:ARG2 range) # A revision argument can be one of: # NUMBER revision number # '{' DATE '}' revision at start of the date # 'HEAD' latest in repository # 'BASE' base rev of item's working copy # 'COMMITTED' last commit at or before BASE # 'PREV' revision just before COMMITTED --quiet(-q) # don't print unversioned items --no-ignore # disregard default and svn:ignore and svn:global-ignores property ignores --incremental # give output suitable for concatenation --xml # output in XML --ignore-externals # ignore externals definitions --changelist:string@"complete svn changelists" # operate only on members of changelist ARG]# FIXME: https://github.com/nushell/nushell/issues/5012# rest parameters do not play well with completions yet# the `paths` parameter should be `...paths`# Put new files and directories under version control.export extern "svn add" [ paths: path@"complete svn add paths" # unversioned PATHs for addition --targets: path # pass contents of file ARG as additional args --non-recursive(-N) # obsolete; same as --depth=empty --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity') --quiet(-q) # print nothing, or only summary information --force # ignore already versioned paths --no-ignore # disregard default and svn:ignore and svn:global-ignores property ignores --auto-props # enable automatic properties --no-auto-props # disable automatic properties --parents # add intermediate parents]# Restore pristine working copy state (undo local changes).export extern "svn revert" [ paths: path@"complete svn revert paths" --targets: path # pass contents of file as additional args --recursive(-R) # descend recursively, same as --depth=infinity --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity') --quiet(-q) # print nothing, or only summary information --changelist: string@"complete svn changelists" # operate only on members of changelist ARG --remove-added # reverting an added item will remove it from disk]# FIXME# SVN uses aliases for subcommands. E.g. `co` for `checkout`.# How to express that with nu extern commands?# Check out a working copy from a repository.export extern "svn checkout" [ ...url_with_rev:string # source path: path # destination --revision(-r) # ARG (some commands also take ARG1:ARG2 range) # A revision argument can be one of: # NUMBER revision number # '{' DATE '}' revision at start of the date # 'HEAD' latest in repository # 'BASE' base rev of item's working copy # 'COMMITTED' last commit at or before BASE # 'PREV' revision just before COMMITTED --quiet(-q) # print nothing, or only summary information --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity') --force # force operation to run --ignore-externals # ignore externals definitions]No final newline+1 / −1 text lines
+50 / −41 text lines
[name bin features]; ["sccache" "sccache" []] ["nu" "nu" ["--features=extra"]] ["sd" "sd" []] ["cbs" "cbs" []] ["ouch" "ouch" []] ["fd-find" "fd" []] ["choose", "choose", []] ["ripgrep" "rg" []] ["onefetch" "onefetch" []] ["eva" "eva" []] ["mdcat" "mdcat" []] ["cargo-update" "cargo-install-update" []] ["hexyl" "hexyl" []] ["hyperfine" "hyperfine" []] ["so" "so" so-features] ["tealdeer" "tldr" []] ["tokei" "tokei" []] ["bat" "bat" []] ["pastel" "pastel" []] ["diskonaut" "diskonaut" []] ["menyoki" "menyoki" []] ["zoxide" "zoxide" []] ["grex" "grex" []] ["xh" "xh" []] ["comrak" "comrak" []] # ["bandwhich" "bandwhich" []] masked until https://github.com/imsnif/bandwhich/issues/233 ["lychee" "lychee" []] ["viu" "viu" []] ["licensor" "licensor" []] ["gib" "gib" []] ["silicon" "silicon" []] ["bottom" "btm" []] ["sic" "sic" []] ["just" "just" []] ["mdsh" "mdsh" []] ["git-delta" "delta" []] ["selene" "selene" ["--no-default-features"]] ["stylua" "stylua" ["--features=lua52"]] ["taplo-cli" "taplo" []] [ name bin features]; [ "sccache" "sccache" [] ] [ "nu" "nu" [ "--features" "extra" ] ] [ "sd" "sd" [] ] [ "cbs" "cbs" [] ] [ "ouch" "ouch" [] ] [ "fd-find" "fd" [] ] [ "choose", "choose", [] ] [ "ripgrep" "rg" [] ] [ "onefetch" "onefetch" [] ] [ "eva" "eva" [] ] [ "mdcat" "mdcat" [] ] [ "cargo-update" "cargo-install-update" [] ] [ "hexyl" "hexyl" [] ] [ "hyperfine" "hyperfine" [] ] [ "so" "so" (so-features) ] [ "tealdeer" "tldr" [] ] [ "tokei" "tokei" [] ] [ "bat" "bat" [] ] [ "pastel" "pastel" [] ] [ "diskonaut" "diskonaut" [] ] [ "menyoki" "menyoki" [] ] [ "zoxide" "zoxide" [] ] [ "grex" "grex" [] ] [ "xh" "xh" [] ] [ "comrak" "comrak" [] ] # [ "bandwhich" "bandwhich" [] ] masked until https://github.com/imsnif/bandwhich/issues/233 [ "lychee" "lychee" [] ] [ "viu" "viu" [] ] [ "licensor" "licensor" [] ] [ "gib" "gib" [] ] [ "silicon" "silicon" [] ] [ "bottom" "btm" [] ] [ "sic" "sic" [] ] [ "just" "just" [] ] [ "mdsh" "mdsh" [] ] [ "git-delta" "delta" [] ] [ "selene" "selene" [ "--no-default-features" ] ] [ "stylua" "stylua" [ "--features" "lua52" ] ] [ "taplo-cli" "taplo" [] ] [ "coreutils" "coreutils" (coreutils-features) ]new file mode 100644+45 / −0 text lines
def main [] { assert-is-a { "" } string assert-is-a { "=" } string assert-is-a { "-" } string assert-is-a { "-=" } string assert-is-a { "-=-" } string assert-is-a { "=-" } string assert-is-a { [""] } list<string> assert-is-a { ["="] } list<string> assert-is-a { ["-"] } list<string> assert-is-a { ["-="] } list<string> # error: unknown command #assert-is-a { ["-=-"] } list<string> #assert-is-a { ["=-"] } list<string> #assert-is-a { ["=-"] } list<string> assert-is-a { ["= "] } list<string> assert-is-a { [ "="] } list<string> assert-is-a { ["=" ] } list<string> assert-is-a { [ "=" ] } list<string> assert-is-a { [ "=OK" ] } list<string>}def assert-is-a [ code: block # some nu expression expected_type: string # expected nu type of given expression, as printed by `describe`] { let span = (metadata $code).span; let actual_type = ( do $code | describe ) if $actual_type == $expected_type { echo $"(char sun)\t(ansi green_bold)OK(ansi reset)\t($actual_type)" } else { error make { msg: $"(char cloud)\t(ansi red_bold)FAIL(ansi reset)", label: { text: $"expected a `($expected_type)` but got a `($actual_type)`", start: $span.start, end: $span.end } } }}No final newline