From 2e8f63858344363678a7366f2b9c431c6cb9ac7b Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 15 Mar 2022 11:24:13 +0100 Subject: [PATCH] add short version of help, as in quit (#10055) * MetaSema: add short version of help, as in quit Primer: join help and ?, mention .quit and .exit TRint: mention .? TApplication: mention .? and CINT 2 Cling * clarify class name with ROOT7 --- core/base/src/TApplication.cxx | 10 +++++----- core/rint/src/TRint.cxx | 2 +- documentation/primer/ROOT_as_calculator.md | 9 ++++----- interpreter/cling/lib/MetaProcessor/MetaSema.cpp | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/core/base/src/TApplication.cxx b/core/base/src/TApplication.cxx index a46fcba811ee2..1d23c1b1f067c 100644 --- a/core/base/src/TApplication.cxx +++ b/core/base/src/TApplication.cxx @@ -1040,7 +1040,7 @@ void TApplication::OpenReferenceGuideFor(const TString &strippedClass) //////////////////////////////////////////////////////////////////////////////// /// The function lists useful commands (".help") or opens the online reference /// guide, generated with Doxygen (".help scope" or ".help scope::member"). -/// +/// \note You can use ".?" as the short version of ".help" /// \param[in] line command from the command line void TApplication::Help(const char *line) @@ -1051,12 +1051,12 @@ void TApplication::Help(const char *line) if ((strippedCommand == ".help") || (strippedCommand == ".?")) { gInterpreter->ProcessLine(line); Printf("\nROOT special commands."); - Printf("=========================================================================="); + Printf("=============================================================================="); Printf(" .pwd : show current directory, pad and style"); Printf(" .ls : list contents of current directory"); Printf(" .which [file] : shows path of macro file"); - Printf(" .help Class : opens the reference guide for that class"); - Printf(" .help Class::Member : opens the reference guide for function/member"); + Printf(" .help Class : opens the reference guide for that class (or .?)"); + Printf(" .help Class::Member : opens the reference guide for function/member (or .?)"); return; } else { // If the user wants to use the extended ".help scopeName" command to access @@ -1439,7 +1439,7 @@ Longptr_t TApplication::ProcessLine(const char *line, Bool_t sync, Int_t *err) } if (!strcmp(line, ".reset")) { - // Do nothing, .reset disabled in CINT because too many side effects + // Do nothing, .reset disabled in Cling because too many side effects Printf("*** .reset not allowed, please use gROOT->Reset() ***"); return 0; diff --git a/core/rint/src/TRint.cxx b/core/rint/src/TRint.cxx index b53ad361d4bb8..003af6c6bd522 100644 --- a/core/rint/src/TRint.cxx +++ b/core/rint/src/TRint.cxx @@ -541,7 +541,7 @@ void TRint::PrintLogo(Bool_t lite) } lines.emplace_back(TString::Format("With %s %%s", gSystem->GetBuildCompilerVersionStr())); - lines.emplace_back(TString("Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'%s")); + lines.emplace_back(TString("Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'%s")); // Find the longest line and its length: auto itLongest = std::max_element(lines.begin(), lines.end(), diff --git a/documentation/primer/ROOT_as_calculator.md b/documentation/primer/ROOT_as_calculator.md index d663abd1cd01b..81218ffa86970 100644 --- a/documentation/primer/ROOT_as_calculator.md +++ b/documentation/primer/ROOT_as_calculator.md @@ -221,9 +221,9 @@ root [1] . This is a selection of the most common commands. -- **quit root**, simply type `.q` +- **quit root**, simply type `.q` or `.quit` or `.exit` -- obtain a **list of commands**, use `.?` +- obtain the full **list of commands**, use `.?` or `.help` - **access the shell** of the operating system, type `.!`; try, e.g. `.!ls` or `.!pwd` @@ -243,8 +243,6 @@ This is a selection of the most common commands. in order to obtain better performance or to get nearer to the production environment. -Use `.help` at the prompt to inspect the full list. - ## Plotting Measurements ## To display measurements in ROOT, including errors, there exists a @@ -517,4 +515,5 @@ features of ROOT. ***Please move on to become an expert!*** [^2]: All ROOT classes' names start with the letter T. A notable exception is -RooFit. In this context all classes' names are of the form Roo*. +RooFit. In this context all classes' names are of the form Roo*. Starting with +ROOT7, all names start with and R. diff --git a/interpreter/cling/lib/MetaProcessor/MetaSema.cpp b/interpreter/cling/lib/MetaProcessor/MetaSema.cpp index cd3cefdf73bac..76cf44c25e8b9 100644 --- a/interpreter/cling/lib/MetaProcessor/MetaSema.cpp +++ b/interpreter/cling/lib/MetaProcessor/MetaSema.cpp @@ -372,7 +372,7 @@ namespace cling { "\t\t\t\t 'decl' dump ast declarations\n" "\t\t\t\t 'undo' show undo stack\n" "\n" - " " << metaString << "help\t\t\t- Shows this information\n" + " " << metaString << "help\t\t\t- Shows this information (also .?)\n" "\n" " " << metaString << "q\t\t\t\t- Exit the program\n" "\n";