@@ -20,7 +20,7 @@ typedef SourceStringTemplate = String Function(String scriptPath);
2020class ShellCompletionConfiguration {
2121 /// {@macro shell_completion_configuration}
2222 const ShellCompletionConfiguration ._({
23- required this .name ,
23+ required this .shell ,
2424 required this .shellRCFile,
2525 required this .sourceLineTemplate,
2626 required this .scriptTemplate,
@@ -38,8 +38,8 @@ class ShellCompletionConfiguration {
3838 }
3939 }
4040
41- /// A descriptive string to identify the shell among others.
42- final String name ;
41+ /// {@macro system_shell}
42+ final SystemShell shell ;
4343
4444 /// The location of a config file that is run upon shell start.
4545 /// Eg: .bash_profile or .zshrc
@@ -52,13 +52,14 @@ class ShellCompletionConfiguration {
5252 final CompletionScriptTemplate scriptTemplate;
5353
5454 /// The name for the config file for this shell.
55- String get completionConfigForShellFileName => '$name -config.$name ' ;
55+ String get completionConfigForShellFileName =>
56+ '${shell .name }-config.${shell .name }' ;
5657}
5758
5859/// A [ShellCompletionConfiguration] for zsh.
5960@visibleForTesting
6061final zshConfiguration = ShellCompletionConfiguration ._(
61- name : ' zsh' ,
62+ shell : SystemShell . zsh,
6263 shellRCFile: '~/.zshrc' ,
6364 sourceLineTemplate: (String scriptPath) {
6465 return '[[ -f $scriptPath ]] && . $scriptPath || true' ;
9192/// A [ShellCompletionConfiguration] for bash.
9293@visibleForTesting
9394final bashConfiguration = ShellCompletionConfiguration ._(
94- name : ' bash' ,
95+ shell : SystemShell . bash,
9596 shellRCFile: '~/.bash_profile' ,
9697 sourceLineTemplate: (String scriptPath) {
9798 return '[ -f $scriptPath ] && . $scriptPath || true' ;
0 commit comments