mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
update open
to use argparse
This commit is contained in:
parent
e8243af20b
commit
51a52a7286
1 changed files with 7 additions and 7 deletions
|
@ -2,16 +2,16 @@
|
||||||
# This allows us to use 'open FILENAME' to open a given file in the default
|
# This allows us to use 'open FILENAME' to open a given file in the default
|
||||||
# application for the file.
|
# application for the file.
|
||||||
#
|
#
|
||||||
|
|
||||||
if not command -sq open
|
if not command -sq open
|
||||||
function open --description "Open file in default application"
|
function open --description "Open file in default application"
|
||||||
if count $argv >/dev/null
|
set -l options 'h/help'
|
||||||
switch $argv[1]
|
argparse -n open --min-args=1 $options -- $argv
|
||||||
case -h --h --he --hel --help
|
or return
|
||||||
|
|
||||||
|
if set -q _flag_help
|
||||||
__fish_print_help open
|
__fish_print_help open
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
if type -q -f cygstart
|
if type -q -f cygstart
|
||||||
for i in $argv
|
for i in $argv
|
||||||
|
|
Loading…
Reference in a new issue