⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rluser.texinfo

📁 这个是LINUX下的GDB调度工具的源码
💻 TEXINFO
📖 第 1 页 / 共 5 页
字号:
@end ifclear@end ftable@node Readline vi Mode@section Readline vi ModeWhile the Readline library does not have a full set of @code{vi}editing functions, it does contain enough to allow simple editingof the line.  The Readline @code{vi} mode behaves as specified inthe @sc{posix} 1003.2 standard.@ifset BashFeaturesIn order to switch interactively between @code{emacs} and @code{vi}editing modes, use the @samp{set -o emacs} and @samp{set -o vi}commands (@pxref{The Set Builtin}).@end ifset@ifclear BashFeaturesIn order to switch interactively between @code{emacs} and @code{vi}editing modes, use the command @kbd{M-C-j} (bound to emacs-editing-modewhen in @code{vi} mode and to vi-editing-mode in @code{emacs} mode).@end ifclearThe Readline default is @code{emacs} mode.When you enter a line in @code{vi} mode, you are already placed in`insertion' mode, as if you had typed an @samp{i}.  Pressing @key{ESC}switches you into `command' mode, where you can edit the text of theline with the standard @code{vi} movement keys, move to previoushistory lines with @samp{k} and subsequent lines with @samp{j}, andso forth.@ifset BashFeatures@node Programmable Completion@section Programmable Completion@cindex programmable completionWhen word completion is attempted for an argument to a command forwhich a completion specification (a @var{compspec}) has been definedusing the @code{complete} builtin (@pxref{Programmable Completion Builtins}),the programmable completion facilities are invoked. First, the command name is identified.If a compspec has been defined for that command, thecompspec is used to generate the list of possible completions for the word.If the command word is a full pathname, a compspec for the fullpathname is searched for first.If no compspec is found for the full pathname, an attempt is made tofind a compspec for the portion following the final slash.Once a compspec has been found, it is used to generate the list ofmatching words.If a compspec is not found, the default Bash completiondescribed above (@pxref{Commands For Completion}) is performed.First, the actions specified by the compspec are used.Only matches which are prefixed by the word being completed arereturned.When the @option{-f} or @option{-d} option is used for filename ordirectory name completion, the shell variable @env{FIGNORE} isused to filter the matches.@xref{Bash Variables}, for a description of @env{FIGNORE}.Any completions specified by a filename expansion pattern to the@option{-G} option are generated next.The words generated by the pattern need not match the word being completed.The @env{GLOBIGNORE} shell variable is not used to filter the matches,but the @env{FIGNORE} shell variable is used.Next, the string specified as the argument to the @option{-W} optionis considered.The string is first split using the characters in the @env{IFS}special variable as delimiters.Shell quoting is honored.Each word is then expanded usingbrace expansion, tilde expansion, parameter and variable expansion,command substitution, arithmetic expansion, and pathname expansion,as described above (@pxref{Shell Expansions}).The results are split using the rules described above(@pxref{Word Splitting}).The results of the expansion are prefix-matched against the word beingcompleted, and the matching words become the possible completions.After these matches have been generated, any shell function or commandspecified with the @option{-F} and @option{-C} options is invoked.When the command or function is invoked, the @env{COMP_LINE} and@env{COMP_POINT} variables are assigned values as described above(@pxref{Bash Variables}).If a shell function is being invoked, the @env{COMP_WORDS} and@env{COMP_CWORD} variables are also set.When the function or command is invoked, the first argument is thename of the command whose arguments are being completed, thesecond argument is the word being completed, and the third argumentis the word preceding the word being completed on the current command line.No filtering of the generated completions against the word being completedis performed; the function or command has complete freedom in generatingthe matches.Any function specified with @option{-F} is invoked first.The function may use any of the shell facilities, including the@code{compgen} builtin described below(@pxref{Programmable Completion Builtins}), to generate the matches.It must put the possible completions in the @env{COMPREPLY} arrayvariable.Next, any command specified with the @option{-C} option is invokedin an environment equivalent to command substitution.It should print a list of completions, one per line, tothe standard output.Backslash may be used to escape a newline, if necessary.After all of the possible completions are generated, any filterspecified with the @option{-X} option is applied to the list.The filter is a pattern as used for pathname expansion; a @samp{&}in the pattern is replaced with the text of the word being completed.A literal @samp{&} may be escaped with a backslash; the backslashis removed before attempting a match.Any completion that matches the pattern will be removed from the list.A leading @samp{!} negates the pattern; in this case any completionnot matching the pattern will be removed.Finally, any prefix and suffix specified with the @option{-P} and @option{-S}options are added to each member of the completion list, and the result isreturned to the Readline completion code as the list of possiblecompletions.If the previously-applied actions do not generate any matches, and the@option{-o dirnames} option was supplied to @code{complete} when thecompspec was defined, directory name completion is attempted. By default, if a compspec is found, whatever it generates is returned tothe completion code as the full set of possible completions.The default Bash completions are not attempted, and the Readline defaultof filename completion is disabled.If the @option{-o default} option was supplied to @code{complete} when thecompspec was defined, Readline's default completion will be performedif the compspec generates no matches.When a compspec indicates that directory name completion is desired,the programmable completion functions force Readline to append a slashto completed names which are symbolic links to directories, subject tothe value of the @var{mark-directories} Readline variable, regardlessof the setting of the @var{mark-symlinked-directories} Readline variable.@node Programmable Completion Builtins@section Programmable Completion Builtins@cindex completion builtinsTwo builtin commands are available to manipulate the programmable completionfacilities.@table @code@item compgen@btindex compgen@example@code{compgen [@var{option}] [@var{word}]}@end exampleGenerate possible completion matches for @var{word} according tothe @var{option}s, which may be any option accepted by the@code{complete}builtin with the exception of @option{-p} and @option{-r}, and writethe matches to the standard output.When using the @option{-F} or @option{-C} options, the various shell variablesset by the programmable completion facilities, while available, will nothave useful values.The matches will be generated in the same way as if the programmablecompletion code had generated them directly from a completion specificationwith the same flags.If @var{word} is specified, only those completions matching @var{word}will be displayed.The return value is true unless an invalid option is supplied, or nomatches were generated.@item complete@btindex complete@example@code{complete [-abcdefgjksuv] [-o @var{comp-option}] [-A @var{action}] [-G @var{globpat}] [-W @var{wordlist}][-P @var{prefix}] [-S @var{suffix}] [-X @var{filterpat}] [-F @var{function}][-C @var{command}] @var{name} [@var{name} @dots{}]}@code{complete -pr [@var{name} @dots{}]}@end exampleSpecify how arguments to each @var{name} should be completed.If the @option{-p} option is supplied, or if no options are supplied, existingcompletion specifications are printed in a way that allows them to bereused as input.The @option{-r} option removes a completion specification foreach @var{name}, or, if no @var{name}s are supplied, allcompletion specifications.The process of applying these completion specifications when word completionis attempted is described above (@pxref{Programmable Completion}).Other options, if specified, have the following meanings.The arguments to the @option{-G}, @option{-W}, and @option{-X} options(and, if necessary, the @option{-P} and @option{-S} options)should be quoted to protect them from expansion before the@code{complete} builtin is invoked.@table @code@item -o @var{comp-option}The @var{comp-option} controls several aspects of the compspec's behaviorbeyond the simple generation of completions.@var{comp-option} may be one of: @table @code@item defaultUse Readline's default filename completion if the compspec generatesno matches.@item dirnamesPerform directory name completion if the compspec generates no matches.@item filenamesTell Readline that the compspec generates filenames, so it can perform anyfilename\-specific processing (like adding a slash to directory names orsuppressing trailing spaces).  This option is intended to be used withshell functions specified with @option{-F}.@item nospaceTell Readline not to append a space (the default) to words completed atthe end of the line.@end table@item -A @var{action}The @var{action} may be one of the following to generate a list of possiblecompletions:@table @code@item aliasAlias names.  May also be specified as @option{-a}.@item arrayvarArray variable names.@item bindingReadline key binding names (@pxref{Bindable Readline Commands}).@item builtinNames of shell builtin commands.  May also be specified as @option{-b}.@item commandCommand names.  May also be specified as @option{-c}.@item directoryDirectory names.  May also be specified as @option{-d}.@item disabledNames of disabled shell builtins.@item enabledNames of enabled shell builtins.@item exportNames of exported shell variables.  May also be specified as @option{-e}.@item fileFile names.  May also be specified as @option{-f}.@item functionNames of shell functions.@item groupGroup names.  May also be specified as @option{-g}.@item helptopicHelp topics as accepted by the @code{help} builtin (@pxref{Bash Builtins}).@item hostnameHostnames, as taken from the file specified by the@env{HOSTFILE} shell variable (@pxref{Bash Variables}).@item jobJob names, if job control is active.  May also be specified as @option{-j}.@item keywordShell reserved words.  May also be specified as @option{-k}.@item runningNames of running jobs, if job control is active.@item serviceService names.  May also be specified as @option{-s}.@item setoptValid arguments for the @option{-o} option to the @code{set} builtin(@pxref{The Set Builtin}).@item shoptShell option names as accepted by the @code{shopt} builtin(@pxref{Bash Builtins}).@item signalSignal names.@item stoppedNames of stopped jobs, if job control is active.@item userUser names.  May also be specified as @option{-u}.@item variableNames of all shell variables.  May also be specified as @option{-v}.@end table@item -G @var{globpat}The filename expansion pattern @var{globpat} is expanded to generatethe possible completions.@item -W @var{wordlist}The @var{wordlist} is split using the characters in the@env{IFS} special variable as delimiters, and each resultant wordis expanded.The possible completions are the members of the resultant list whichmatch the word being completed.@item -C @var{command}@var{command} is executed in a subshell environment, and its output isused as the possible completions.@item -F @var{function}The shell function @var{function} is executed in the current shellenvironment.When it finishes, the possible completions are retrieved from the valueof the @env{COMPREPLY} array variable.@item -X @var{filterpat}@var{filterpat} is a pattern as used for filename expansion.It is applied to the list of possible completions generated by thepreceding options and arguments, and each completion matching@var{filterpat} is removed from the list.A leading @samp{!} in @var{filterpat} negates the pattern; in thiscase, any completion not matching @var{filterpat} is removed.@item -P @var{prefix}@var{prefix} is added at the beginning of each possible completionafter all other options have been applied.@item -S @var{suffix}@var{suffix} is appended to each possible completionafter all other options have been applied.@end tableThe return value is true unless an invalid option is supplied, an optionother than @option{-p} or @option{-r} is supplied without a @var{name}argument, an attempt is made to remove a completion specification fora @var{name} for which no specification exists, oran error occurs adding a completion specification.@end table@end ifset

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -