fix(cli): revert to previous flag names

relates to #1913
This commit is contained in:
Jan De Dobbeleer 2022-03-13 07:51:51 +01:00 committed by Jan De Dobbeleer
parent 0bd957fc76
commit 35c76bdf75
6 changed files with 10 additions and 10 deletions

View file

@ -113,8 +113,8 @@ func init() { // nolint:gochecknoinits
printCmd.Flags().StringVar(&pwd, "pwd", "", "current working directory") printCmd.Flags().StringVar(&pwd, "pwd", "", "current working directory")
printCmd.Flags().StringVar(&pswd, "pswd", "", "current working directory (according to pwsh)") printCmd.Flags().StringVar(&pswd, "pswd", "", "current working directory (according to pwsh)")
printCmd.Flags().StringVar(&shell, "shell", "", "the shell to print for") printCmd.Flags().StringVar(&shell, "shell", "", "the shell to print for")
printCmd.Flags().IntVarP(&exitCode, "exit", "e", 0, "last exit code") printCmd.Flags().IntVarP(&exitCode, "error", "e", 0, "last exit code")
printCmd.Flags().Float64VarP(&timing, "timing", "t", 0, "timing of the last command") printCmd.Flags().Float64Var(&timing, "execution-time", 0, "timing of the last command")
printCmd.Flags().IntVarP(&stackCount, "stack-count", "s", 0, "number of locations on the stack") printCmd.Flags().IntVarP(&stackCount, "stack-count", "s", 0, "number of locations on the stack")
printCmd.Flags().IntVarP(&terminalWidth, "terminal-width", "w", 0, "width of the terminal") printCmd.Flags().IntVarP(&terminalWidth, "terminal-width", "w", 0, "width of the terminal")
printCmd.Flags().StringVar(&command, "command", "", "tooltip command") printCmd.Flags().StringVar(&command, "command", "", "tooltip command")

View file

@ -25,7 +25,7 @@ function _omp_hook() {
omp_elapsed=$((omp_now-omp_start_time)) omp_elapsed=$((omp_now-omp_start_time))
rm -f "$TIMER_START" rm -f "$TIMER_START"
fi fi
PS1="$(::OMP:: prompt print primary --config="$POSH_THEME" --shell=bash --exit="$ret" --timing="$omp_elapsed" --stack-count="$omp_stack_count" | tr -d '\0')" PS1="$(::OMP:: prompt print primary --config="$POSH_THEME" --shell=bash --error="$ret" --execution-time="$omp_elapsed" --stack-count="$omp_stack_count" | tr -d '\0')"
return $ret return $ret
} }

View file

@ -18,11 +18,11 @@ function fish_prompt
set -gx omp_last_status_generation $status_generation set -gx omp_last_status_generation $status_generation
end end
::OMP:: prompt print primary --config $POSH_THEME --shell fish --exit $omp_status_cache --timing $omp_duration --stack-count $omp_stack_count ::OMP:: prompt print primary --config $POSH_THEME --shell fish --error $omp_status_cache --execution-time $omp_duration --stack-count $omp_stack_count
end end
function fish_right_prompt function fish_right_prompt
::OMP:: prompt print right --config $POSH_THEME --shell fish --exit $omp_status_cache --timing $omp_duration --stack-count $omp_stack_count ::OMP:: prompt print right --config $POSH_THEME --shell fish --error $omp_status_cache --execution-time $omp_duration --stack-count $omp_stack_count
end end
function postexec_omp --on-event fish_postexec function postexec_omp --on-event fish_postexec

View file

@ -61,14 +61,14 @@ end
local function execution_time_option() local function execution_time_option()
if last_duration ~= nil then if last_duration ~= nil then
return "--timing "..last_duration return "--execution-time "..last_duration
end end
return "" return ""
end end
local function error_level_option() local function error_level_option()
if os.geterrorlevel ~= nil and settings.get("cmd.get_errorlevel") then if os.geterrorlevel ~= nil and settings.get("cmd.get_errorlevel") then
return "--exit "..os.geterrorlevel() return "--error "..os.geterrorlevel()
end end
return "" return ""
end end

View file

@ -94,7 +94,7 @@ function global:Initialize-ModuleSupport {
$global:omp_lastHistoryId = $history.Id $global:omp_lastHistoryId = $history.Id
} }
$terminalWidth = $Host.UI.RawUI.WindowSize.Width $terminalWidth = $Host.UI.RawUI.WindowSize.Width
$standardOut = @(&$omp prompt print primary --exit="$errorCode" --pwd="$cleanPWD" --pswd="$cleanPSWD" --timing="$executionTime" --stack-count="$stackCount" --config="$config" --terminal-width=$terminalWidth 2>&1) $standardOut = @(&$omp prompt print primary --error="$errorCode" --pwd="$cleanPWD" --pswd="$cleanPSWD" --execution-time="$executionTime" --stack-count="$stackCount" --config="$config" --terminal-width=$terminalWidth 2>&1)
# make sure PSReadLine knows we have a multiline prompt # make sure PSReadLine knows we have a multiline prompt
$extraLines = $standardOut.Count - 1 $extraLines = $standardOut.Count - 1
if ($extraLines -gt 0) { if ($extraLines -gt 0) {
@ -112,7 +112,7 @@ Set-Item -Path Function:prompt -Value $Prompt -Force
function global:Write-PoshDebug { function global:Write-PoshDebug {
$omp = "::OMP::" $omp = "::OMP::"
$config, $cleanPWD, $cleanPSWD = Get-PoshContext $config, $cleanPWD, $cleanPSWD = Get-PoshContext
$standardOut = @(&$omp prompt print debug --exit=1337 --pwd="$cleanPWD" --pswd="$cleanPSWD" --timing=9001 --config="$config" 2>&1) $standardOut = @(&$omp prompt print debug --error=1337 --pwd="$cleanPWD" --pswd="$cleanPSWD" --execution-time=9001 --config="$config" 2>&1)
$standardOut -join "`n" $standardOut -join "`n"
} }

View file

@ -17,7 +17,7 @@ function prompt_ohmyposh_precmd() {
omp_now=$(::OMP:: config get millis) omp_now=$(::OMP:: config get millis)
omp_elapsed=$(($omp_now-$omp_start_time)) omp_elapsed=$(($omp_now-$omp_start_time))
fi fi
eval "$(::OMP:: prompt print primary --config="$POSH_THEME" --exit="$omp_last_error" --timing="$omp_elapsed" --stack-count="$omp_stack_count" --eval --shell=zsh)" eval "$(::OMP:: prompt print primary --config="$POSH_THEME" --error="$omp_last_error" --execution-time="$omp_elapsed" --stack-count="$omp_stack_count" --eval --shell=zsh)"
unset omp_start_time unset omp_start_time
unset omp_now unset omp_now
unset omp_elapsed unset omp_elapsed