Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Crans Passwords
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nounous
Crans Passwords
Commits
53324fa3
Commit
53324fa3
authored
11 years ago
by
Valentin Samir
Browse files
Options
Downloads
Patches
Plain Diff
[bash_completion] Get rid of contain function
parent
dae7b30c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cranspasswords_bash_completion
+2
-13
2 additions, 13 deletions
cranspasswords_bash_completion
with
2 additions
and
13 deletions
cranspasswords_bash_completion
+
2
−
13
View file @
53324fa3
# Fonction de notre auto completion
# Fonction de notre auto completion
contain(){
local i
for i in $2; do
if [[ "$i" = "$1" ]]; then
return 0
fi
done
return 1
}
if [[ "$EDITOR" = "" ]]; then
if [[ "$EDITOR" = "" ]]; then
export EDITOR="nano";
export EDITOR="nano";
fi
fi
...
@@ -18,7 +7,7 @@ fi
...
@@ -18,7 +7,7 @@ fi
_cranspasswords(){
_cranspasswords(){
# declaration des variables locales
# declaration des variables locales
local argc first last prev cur cur_first_char opts_short opts role_dir pass_dir server server_list role_list pass_list timeout
local argc first last prev cur cur_first_char opts_short opts role_dir pass_dir server server_list role_list pass_list timeout
role_dir="/tmp/cranspasswords-$USER-role/"
role_dir="/tmp/cranspasswords-$USER-role/"
pass_dir="/tmp/cranspasswords-$USER-passwords/"
pass_dir="/tmp/cranspasswords-$USER-passwords/"
# Combien de temps on garde les réponses du serveur en cache (en minutes)
# Combien de temps on garde les réponses du serveur en cache (en minutes)
...
@@ -46,7 +35,7 @@ _cranspasswords(){
...
@@ -46,7 +35,7 @@ _cranspasswords(){
find "$pass_dir" -type f -mmin +$timeout -exec rm -f {} \;
find "$pass_dir" -type f -mmin +$timeout -exec rm -f {} \;
# On détermine si on utilsie un serveur alternatif
# On détermine si on utilsie un serveur alternatif
if
contain "--server"
"${COMP_WORDS[*]}"; then
if
[[
"${COMP_WORDS[*]}"
= *" --server "* ]]
; then
if [[ "$prev" = "--server" ]]; then
if [[ "$prev" = "--server" ]]; then
_cranspasswords_server=$last;
_cranspasswords_server=$last;
fi
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment