diff --git a/src/builtin.cpp b/src/builtin.cpp index da8bdeb18..686dfbace 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -167,7 +167,7 @@ void builtin_print_help(parser_t &parser, const io_streams_t &streams, const wch } auto res = parser.eval(cmd, ios); if (res.status.exit_code() == 2) { - streams.err.append_format(BUILTIN_ERR_MISSING_HELP, name_esc.c_str()); + streams.err.append_format(BUILTIN_ERR_MISSING_HELP, name_esc.c_str(), name_esc.c_str()); } } diff --git a/src/builtin.h b/src/builtin.h index 0d7831c25..00b9ec6c6 100644 --- a/src/builtin.h +++ b/src/builtin.h @@ -38,7 +38,7 @@ enum { COMMAND_NOT_BUILTIN, BUILTIN_REGULAR, BUILTIN_FUNCTION }; /// Error message on missing man page. #define BUILTIN_ERR_MISSING_HELP \ - _(L"fish: Missing man page for '%ls'. Did you install the documentation?\n") + _(L"fish: Missing man page for '%ls'. Did you install the documentation?\n`help '%ls'` will open the online version.\n") /// Error message on invalid combination of options. #define BUILTIN_ERR_COMBO _(L"%ls: Invalid combination of options\n") diff --git a/tests/checks/andandoror.fish b/tests/checks/andandoror.fish index 60f7a9a0a..4148d00e2 100644 --- a/tests/checks/andandoror.fish +++ b/tests/checks/andandoror.fish @@ -114,27 +114,33 @@ echo comment after conjunction # --help works builtin and --help >/dev/null # CHECKERR: fish: Missing man page {{.*}} +# CHECKERR: `help '{{.*}}'` will open the online version. echo $status and --help >/dev/null # CHECKERR: fish: Missing man page {{.*}} +# CHECKERR: `help '{{.*}}'` will open the online version. echo $status # CHECK: 0 # CHECK: 0 builtin or --help >/dev/null # CHECKERR: fish: Missing man page {{.*}} +# CHECKERR: `help '{{.*}}'` will open the online version. echo $status or --help >/dev/null # CHECKERR: fish: Missing man page {{.*}} +# CHECKERR: `help '{{.*}}'` will open the online version. echo $status # CHECK: 0 # CHECK: 0 builtin not --help >/dev/null # CHECKERR: fish: Missing man page {{.*}} +# CHECKERR: `help '{{.*}}'` will open the online version. echo $status not --help >/dev/null # CHECKERR: fish: Missing man page {{.*}} +# CHECKERR: `help '{{.*}}'` will open the online version. echo $status # CHECK: 0 # CHECK: 0 diff --git a/tests/checks/scoping.fish b/tests/checks/scoping.fish index 8153da115..727486530 100644 --- a/tests/checks/scoping.fish +++ b/tests/checks/scoping.fish @@ -242,6 +242,8 @@ echo 7 $status # no passthrough false set -h >/dev/null # CHECKERR: fish: Missing man page {{.*}} +# CHECKERR: `help '{{.*}}'` will open the online version. + echo 8 $status # no passthrough #CHECK: 8 0 true