From 0be5020bf814efd040f7dcd35cc3a9f07d113458 Mon Sep 17 00:00:00 2001 From: Bartosz Kosiorek Date: Thu, 3 Dec 2015 00:43:37 +0100 Subject: [PATCH] cmake: Improve '-E' help message formatting --- Help/manual/cmake.1.rst | 4 ++-- Source/cmcmd.cxx | 12 ++++++------ Tests/RunCMake/CommandLine/E-no-arg-stderr.txt | 2 +- .../CommandLine/E_create_symlink-no-arg-stderr.txt | 2 +- .../RunCMake/CommandLine/E_rename-no-arg-stderr.txt | 2 +- .../CommandLine/E_touch_nocreate-no-arg-stderr.txt | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index dac16bf3f..3bfab7b5f 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -193,10 +193,10 @@ Available commands are: ``make_directory `` Create a directory. -``md5sum [...]`` +``md5sum ...`` Compute md5sum of files. -``remove [-f] [...]`` +``remove [-f] ...`` Remove the file(s), use ``-f`` to force it. ``remove_directory `` diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 21b126ba7..70107eb23 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -52,7 +52,7 @@ void CMakeCommandUsage(const char* program) // If you add new commands, change here, // and in cmakemain.cxx in the options table errorStream - << "Usage: " << program << " -E [command] [arguments ...]\n" + << "Usage: " << program << " -E [arguments...]\n" << "Available commands: \n" << " chdir dir cmd [args]... - run command in a given directory\n" << " compare_files file1 file2 - check if file1 is same as file2\n" @@ -62,15 +62,15 @@ void CMakeCommandUsage(const char* program) "content to directory 'destination'\n" << " copy_if_different in-file out-file - copy file if input has " "changed\n" - << " echo [string]... - displays arguments as text\n" - << " echo_append [string]... - displays arguments as text but no new " + << " echo [...] - displays arguments as text\n" + << " echo_append [...] - displays arguments as text but no new " "line\n" << " env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...\n" << " - run command in a modified environment\n" << " environment - display the current environment\n" << " make_directory dir - create a directory\n" - << " md5sum file1 [...] - compute md5sum of files\n" - << " remove [-f] file1 file2 ... - remove the file(s), use -f to force " + << " md5sum ... - compute md5sum of files\n" + << " remove [-f] ... - remove the file(s), use -f to force " "it\n" << " remove_directory dir - remove a directory and its contents\n" << " rename oldname newname - rename a file or directory " @@ -78,7 +78,7 @@ void CMakeCommandUsage(const char* program) << " tar [cxt][vf][zjJ] file.tar [file/dir1 file/dir2 ...]\n" << " - create or extract a tar or zip archive\n" << " sleep ... - sleep for given number of seconds\n" - << " time command [args] ... - run command and return elapsed time\n" + << " time command [args...] - run command and return elapsed time\n" << " touch file - touch a file.\n" << " touch_nocreate file - touch a file but do not create it.\n" #if defined(_WIN32) && !defined(__CYGWIN__) diff --git a/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt index 056ce052d..50d9b0332 100644 --- a/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt +++ b/Tests/RunCMake/CommandLine/E-no-arg-stderr.txt @@ -1,3 +1,3 @@ ^CMake Error: cmake version .* -Usage: .* -E \[command\] \[arguments ...\] +Usage: .* -E \[arguments\.\.\.\] Available commands: diff --git a/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt index 056ce052d..50d9b0332 100644 --- a/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt +++ b/Tests/RunCMake/CommandLine/E_create_symlink-no-arg-stderr.txt @@ -1,3 +1,3 @@ ^CMake Error: cmake version .* -Usage: .* -E \[command\] \[arguments ...\] +Usage: .* -E \[arguments\.\.\.\] Available commands: diff --git a/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt index 056ce052d..50d9b0332 100644 --- a/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt +++ b/Tests/RunCMake/CommandLine/E_rename-no-arg-stderr.txt @@ -1,3 +1,3 @@ ^CMake Error: cmake version .* -Usage: .* -E \[command\] \[arguments ...\] +Usage: .* -E \[arguments\.\.\.\] Available commands: diff --git a/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt index 056ce052d..50d9b0332 100644 --- a/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt +++ b/Tests/RunCMake/CommandLine/E_touch_nocreate-no-arg-stderr.txt @@ -1,3 +1,3 @@ ^CMake Error: cmake version .* -Usage: .* -E \[command\] \[arguments ...\] +Usage: .* -E \[arguments\.\.\.\] Available commands: