diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4436d995a..7b8b81908 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -475,7 +475,7 @@ Improved terminal support Other improvements ------------------ -- ``status`` gained a ``buildinfo`` subcommand, to print information on how fish was built, to help with debugging (:issue:`10896`). +- ``status`` gained a ``build-info`` subcommand, to print information on how fish was built, to help with debugging (:issue:`10896`). - ``fish_indent`` will now collapse multiple empty lines into one (:issue:`10325`). - ``fish_indent`` now preserves the modification time of files if there were no changes (:issue:`10624`). - Performance in launching external processes has been improved for many cases (:issue:`10869`). diff --git a/doc_src/cmds/status.rst b/doc_src/cmds/status.rst index d0c917385..141201fcb 100644 --- a/doc_src/cmds/status.rst +++ b/doc_src/cmds/status.rst @@ -30,7 +30,7 @@ Synopsis status job-control CONTROL_TYPE status features status test-feature FEATURE - status buildinfo + status build-info status get-file FILE status list-files [PATH] @@ -104,7 +104,7 @@ The following operations (subcommands) are available: **test-feature** *FEATURE* Returns 0 when FEATURE is enabled, 1 if it is disabled, and 2 if it is not recognized. -**buildinfo** +**build-info** This prints information on how fish was build - which architecture, which build system or profile was used, etc. This is mainly useful for debugging. diff --git a/share/completions/status.fish b/share/completions/status.fish index 75ea4b6a6..4091fdf97 100644 --- a/share/completions/status.fish +++ b/share/completions/status.fish @@ -1,7 +1,7 @@ # Note that when a completion file is sourced a new block scope is created so `set -l` works. set -l __fish_status_all_commands \ basename \ - buildinfo \ + build-info \ current-command \ current-commandline \ current-filename \ @@ -44,7 +44,7 @@ complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_com complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a is-full-job-control -d "Test if all new jobs are put under job control" # The subcommands that are not "is-something" which don't change the fish state. -complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a buildinfo -d "Print information on how this version fish was built" +complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a build-info -d "Print information on how this version fish was built" complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a current-command -d "Print the name of the currently running command or function" complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a current-commandline -d "Print the currently running command with its arguments" complete -f -c status -n "not __fish_seen_subcommand_from $__fish_status_all_commands" -a current-filename -d "Print the filename of the currently running script" diff --git a/src/builtins/status.rs b/src/builtins/status.rs index 3abc0876c..39b7d5a60 100644 --- a/src/builtins/status.rs +++ b/src/builtins/status.rs @@ -59,6 +59,7 @@ enum StatusCmd { STATUS_STACK_TRACE, STATUS_TEST_FEATURE, STATUS_CURRENT_COMMANDLINE, + STATUS_BUILD_INFO, STATUS_BUILDINFO, STATUS_GET_FILE, STATUS_LIST_FILES, @@ -68,6 +69,7 @@ enum StatusCmd { StatusCmd, (STATUS_BASENAME, "basename"), (STATUS_BASENAME, "current-basename"), + (STATUS_BUILD_INFO, "build-info"), (STATUS_BUILDINFO, "buildinfo"), (STATUS_CURRENT_CMD, "current-command"), (STATUS_CURRENT_COMMANDLINE, "current-commandline"), @@ -546,7 +548,7 @@ pub fn status(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr]) -> B return Err(STATUS_INVALID_ARGS); } match s { - STATUS_BUILDINFO => { + STATUS_BUILD_INFO | STATUS_BUILDINFO => { let version = str2wcstring(crate::BUILD_VERSION.as_bytes()); let target = str2wcstring(env!("BUILD_TARGET_TRIPLE").as_bytes()); let host = str2wcstring(env!("BUILD_HOST_TRIPLE").as_bytes()); diff --git a/tests/checks/buildinfo.fish b/tests/checks/build-info.fish similarity index 75% rename from tests/checks/buildinfo.fish rename to tests/checks/build-info.fish index 48b938549..92befb004 100644 --- a/tests/checks/buildinfo.fish +++ b/tests/checks/build-info.fish @@ -6,10 +6,13 @@ # Profile: release # Features: gettext -status buildinfo | grep -v 'Host:' +status build-info | grep -v 'Host:' # CHECK: Build system: {{CMake|Cargo}} # CHECK: Version: {{.+}} # (this could be "Target (and Host)" or "Target:" and a separate line "Host:") # CHECK: Target{{.*}}: {{.+}} # CHECK: Profile: {{release|debug}} # CHECK: Features:{{.*}} + +test "$(status build-info)" = "$(status buildinfo)" +or echo 'missing backwards-compatible version?'