From 51a52a7286b6d7cdb58108f49d11592986a08fc1 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Thu, 13 Jul 2017 13:55:15 -0700 Subject: [PATCH] update `open` to use `argparse` --- share/functions/open.fish | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/share/functions/open.fish b/share/functions/open.fish index e878435ee..a4fce0918 100644 --- a/share/functions/open.fish +++ b/share/functions/open.fish @@ -2,15 +2,15 @@ # This allows us to use 'open FILENAME' to open a given file in the default # application for the file. # - if not command -sq open function open --description "Open file in default application" - if count $argv >/dev/null - switch $argv[1] - case -h --h --he --hel --help - __fish_print_help open - return 0 - end + set -l options 'h/help' + argparse -n open --min-args=1 $options -- $argv + or return + + if set -q _flag_help + __fish_print_help open + return 0 end if type -q -f cygstart