MCPcopy Create free account
hub / github.com/catboost/catboost / MakeInfo

Function MakeInfo

library/cpp/getopt/small/completer_command.cpp:12–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11namespace NLastGetopt {
12 TString MakeInfo(TStringBuf command, TStringBuf flag) {
13 TString info = (
14 "This command generates shell script with completion function and prints it to `stdout`, "
15 "allowing one to re-direct the output to the file of their choosing. "
16 "Where you place the file will depend on which shell and operating system you are using."
17 "\n"
18 "\n"
19 "\n"
20 "{B}BASH (Linux){R}:"
21 "\n"
22 "\n"
23 "For system-wide commands, completion files are stored in `/etc/bash_completion.d/`. "
24 "For user commands, they are stored in `~/.local/share/bash-completion/completions`. "
25 "So, pipe output of this script to a file in one of these directories:"
26 "\n"
27 "\n"
28 " $ mkdir -p ~/.local/share/bash-completion/completions"
29 "\n"
30 " $ {command} {completion} bash >"
31 "\n"
32 " ~/.local/share/bash-completion/completions/{command}"
33 "\n"
34 "\n"
35 "You'll need to restart your shell for changes to take effect."
36 "\n"
37 "\n"
38 "\n"
39 "{B}BASH (OSX){R}:"
40 "\n"
41 "\n"
42 "You'll need `bash-completion` (or `bash-completion@2` if you're using non-default, newer bash) "
43 "homebrew formula. Completion files are stored in `/usr/local/etc/bash_completion.d`:"
44 "\n"
45 "\n"
46 " $ mkdir -p $(brew --prefix)/etc/bash_completion.d"
47 "\n"
48 " $ {command} {completion} bash >"
49 "\n"
50 " $(brew --prefix)/etc/bash_completion.d/{command}"
51 "\n"
52 "\n"
53 "Alternatively, just source the script in your `~/.bash_profile`."
54 "\n"
55 "\n"
56 "You'll need to restart your shell for changes to take effect."
57 "\n"
58 "\n"
59 "\n"
60 "{B}ZSH{R}:"
61 "\n"
62 "\n"
63 "Zsh looks for completion scripts in any directory listed in `$fpath` variable. We recommend placing "
64 "completions to `~/.zfunc`:"
65 "\n"
66 "\n"
67 " $ mkdir -m755 -p ~/.zfunc"
68 "\n"
69 " $ {command} {completion} zsh > ~/.zfunc/_{command}"

Callers 2

MakeCompletionOptFunction · 0.85
RegisterOptionsMethod · 0.85

Calls 3

LightDefaultMethod · 0.80
SubstGlobalFunction · 0.50
ResetMethod · 0.45

Tested by

no test coverage detected