Skip to content

Commit

Permalink
remove deprecated --switch: bool (#154)
Browse files Browse the repository at this point in the history
related to
- nushell/nushell#11365

## description
this PR will suppress the deprecation warning from
nushell/nushell#11365 which is deprecating `:
bool` annotations for switches
  • Loading branch information
amtoine committed Jan 21, 2024
1 parent f233e49 commit a660163
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use style.nu [color]
# │ type │ detached │
# ╰──────┴──────────╯
export def get-revision [
--short-hash: bool # print the hash of a detached HEAD in short format
--short-hash # print the hash of a detached HEAD in short format
]: nothing -> record<name: string, hash: string, type: string> {
let tag = do -i {
^git describe HEAD --tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export def get-left-prompt [duration_threshold: duration]: nothing -> string {
}

let git_branch_segment = if $is_git_repo {
let revision = get-revision --short-hash true
let revision = get-revision --short-hash
let pretty_branch_tokens = match $revision.type {
"branch" => [
($revision.name | color {fg: "yellow", attr: "ub"}),
Expand Down
2 changes: 1 addition & 1 deletion pkgs/nu-git-manager-sugar/tests/git.nu
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export module prompt {
]

def "assert revision" [expected: record] {
let actual = get-revision --short-hash true
let actual = get-revision --short-hash
assert equal $actual $expected
}

Expand Down

0 comments on commit a660163

Please sign in to comment.