Skip to content

Commit

Permalink
add short version of help, as in quit (#10055)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ferdymercury authored Mar 15, 2022
1 parent f9670a3 commit 2e8f638
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
10 changes: 5 additions & 5 deletions core/base/src/TApplication.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion core/rint/src/TRint.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
9 changes: 4 additions & 5 deletions documentation/primer/ROOT_as_calculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ root [1] .<command>

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 `.!<OS_command>`;
try, e.g. `.!ls` or `.!pwd`
Expand All @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion interpreter/cling/lib/MetaProcessor/MetaSema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 2e8f638

Please sign in to comment.