mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 19:53:36 +08:00
a121833e88
A broken/missing optspec or `--` is a bug in the script using argparse, an unknown option or invalid argument is a bug in using that script. So in the former case print a stacktrace, because the person writing the `argparse` call is at fault, in the latter don't. Fixes #6703.
25 lines
521 B
Fish
25 lines
521 B
Fish
# RUN: %fish %s
|
|
#
|
|
# These lines left around because we need the line numbers.
|
|
# This file in general requires careful editing in the middle, I recommend appending.
|
|
function t --on-event linenumber
|
|
status line-number
|
|
status line-number
|
|
status line-number
|
|
end
|
|
|
|
emit linenumber
|
|
# CHECK: 6
|
|
# CHECK: 7
|
|
# CHECK: 8
|
|
|
|
type --nonexistent-option-so-we-get-a-backtrace
|
|
# CHECKERR: type: Unknown option '--nonexistent-option-so-we-get-a-backtrace'
|
|
|
|
function line-number
|
|
status line-number
|
|
end
|
|
|
|
line-number
|
|
# CHECK: 20
|