diff --git a/example/pubspec.yaml b/example/pubspec.yaml index d7a487f..f7b498b 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 publish_to: none environment: - sdk: ^3.8.1 + sdk: ^3.12.0 dependencies: args: ^2.5.0 diff --git a/lib/src/installer/shell_completion_configuration.dart b/lib/src/installer/shell_completion_configuration.dart index 4280e9d..bb099f2 100644 --- a/lib/src/installer/shell_completion_configuration.dart +++ b/lib/src/installer/shell_completion_configuration.dart @@ -65,10 +65,10 @@ class ShellCompletionConfiguration { final zshConfiguration = ShellCompletionConfiguration._( shell: SystemShell.zsh, shellRCFiles: const ['~/.zshrc'], - sourceLineTemplate: (String scriptPath) { + sourceLineTemplate: (scriptPath) { return '[[ -f $scriptPath ]] && . $scriptPath || true'; }, - scriptTemplate: (String rootCommand) { + scriptTemplate: (rootCommand) { // Completion script for zsh. // // Based on https://github.com/mklabs/tabtab/blob/master/lib/scripts/zsh.sh @@ -80,13 +80,13 @@ if type compdef &>/dev/null; then IFS=\$'\n' reply=(\$(COMP_CWORD="\$((CURRENT-1))" COMP_LINE="\$BUFFER" COMP_POINT="\$CURSOR" $rootCommand completion -- "\${words[@]}")) IFS=\$si - + zstyle ':completion:*' menu yes select zstyle ':completion:*' list-colors '' if [[ -z "\$reply" ]]; then _path_files - else + else _describe 'values' reply fi } @@ -101,10 +101,10 @@ fi final bashConfiguration = ShellCompletionConfiguration._( shell: SystemShell.bash, shellRCFiles: const ['~/.bashrc', '~/.bash_profile'], - sourceLineTemplate: (String scriptPath) { + sourceLineTemplate: (scriptPath) { return '[ -f $scriptPath ] && . $scriptPath || true'; }, - scriptTemplate: (String rootCommand) { + scriptTemplate: (rootCommand) { // Completion script for bash. // // Based on https://github.com/mklabs/tabtab/blob/master/lib/scripts/bash.sh diff --git a/pubspec.yaml b/pubspec.yaml index fe007f6..fa706e5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,7 +9,7 @@ screenshots: path: doc/screen.png environment: - sdk: ^3.8.1 + sdk: ^3.12.0 dependencies: args: ^2.5.0 diff --git a/test/src/installer/shell_completion_configuration_test.dart b/test/src/installer/shell_completion_configuration_test.dart index 22fbba7..347582c 100644 --- a/test/src/installer/shell_completion_configuration_test.dart +++ b/test/src/installer/shell_completion_configuration_test.dart @@ -35,13 +35,13 @@ if type compdef &>/dev/null; then IFS=\$'\n' reply=(\$(COMP_CWORD="\$((CURRENT-1))" COMP_LINE="\$BUFFER" COMP_POINT="\$CURSOR" very_good completion -- "\${words[@]}")) IFS=\$si - + zstyle ':completion:*' menu yes select zstyle ':completion:*' list-colors '' if [[ -z "\$reply" ]]; then _path_files - else + else _describe 'values' reply fi }