Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
validate_workflows
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Digital Preservation
validate_workflows
Commits
28fe956a
Commit
28fe956a
authored
2 years ago
by
Andreas Romeyke
Browse files
Options
Downloads
Patches
Plain Diff
- added first draft for bash completion, needs more work!
parent
30ea5e8a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test_complete.sh
+33
-0
33 additions, 0 deletions
test_complete.sh
validate_workflow.sh
+11
-1
11 additions, 1 deletion
validate_workflow.sh
with
44 additions
and
1 deletion
test_complete.sh
0 → 100644
+
33
−
0
View file @
28fe956a
SELF
=
./validate_workflow.sh
_validate_workflow_completion
()
{
local
cur prev opts
COMPREPLY
=()
cur
=
"
${
COMP_WORDS
[COMP_CWORD]
}
"
prev
=
"
${
COMP_WORDS
[COMP_CWORD-1]
}
"
opts
=
$(
cat
$SELF
|
grep
"^#hh
\s
-., --[a-z]"
|
sed
-e
"s/^#hh.*
\(
-.
\)
,
\(
--[a-z-]*
\)
.*/
\1
\2
/g"
)
2>&1
echo
"OPTS:
$opts
"
case
"
$prev
"
in
--pipe
)
prev
=
$(
echo
$prev
|
sed
-e
"s/--
\(
daemon
\|
watch-folder
\|
result_folder
\|
valid_folder
\|
invalid_folder
\)
//g"
)
return
0
;;
--mode
)
COMPREPLY
=(
$(
compgen
-W
"auto mediathek fotothek save kitodo lfulg"
--
${
cur
}
)
)
return
0
;;
--files-mode
)
COMPREPLY
=(
$(
compgen
-W
"nothing sort delete"
--
${
cur
}
)
)
return
0
;;
-reset_failed_preingest
|
--reset_failed_preingest
)
_pushd /mnt/import
_filedir
-d
_popd
return
;;
esac
# debug
2>&1
echo
"PREVS:
$prevs
"
}
complete
-F
_validate_workflow_completion validate_workflow.sh
This diff is collapsed.
Click to expand it.
validate_workflow.sh
+
11
−
1
View file @
28fe956a
...
@@ -54,7 +54,9 @@
...
@@ -54,7 +54,9 @@
#hh -p, --pipe
#hh -p, --pipe
#hh validates a single filestream from STDIN, writes result to STDOUT
#hh validates a single filestream from STDIN, writes result to STDOUT
#hh no daemon, no folder nor filemode params needed
#hh no daemon, no folder nor filemode params needed
#hh
#hh -G, --gen-bash-complete
#hh prints a script for bash autocompletion, should be copied
#hh to /etc/bash_completion.d/validate_workflow
#hh
#hh
# expected programs:
# expected programs:
...
@@ -171,6 +173,14 @@ get_cli_args() {
...
@@ -171,6 +173,14 @@ get_cli_args() {
comment_help
comment_help
exit
0
exit
0
;;
;;
-G
|
--gen_bash_complete
)
cat
<<
COMPLETE
complete -F _validate_workflow_completion
$(
basename
"
${
0
}
"
)
COMPLETE
exit
0
;;
-D
|
--debug
)
-D
|
--debug
)
WITH_DEBUG
=
1
WITH_DEBUG
=
1
shift
shift
...
...
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