mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
git-serve: Format usage text automatically
Remove the formatting of the usage text and add code to columnize it automatically instead. Also, add more strict tests for the usage output. These new tests ensure that the usage header is printed, commands are indented properly and no overly long lines are produced. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
ab228fd3c3
commit
e045069421
2 changed files with 27 additions and 9 deletions
|
@ -9,7 +9,15 @@ test_expect_success 'Test interactive shell.' '
|
|||
'
|
||||
|
||||
test_expect_success 'Test help.' '
|
||||
SSH_ORIGINAL_COMMAND=help "$GIT_SERVE" 2>&1 | grep -q "^Commands:$"
|
||||
SSH_ORIGINAL_COMMAND=help "$GIT_SERVE" 2>actual &&
|
||||
save_IFS=$IFS
|
||||
IFS=
|
||||
while read -r line; do
|
||||
echo $line | grep -q "^Commands:$" && continue
|
||||
echo $line | grep -q "^ [a-z]" || return 1
|
||||
[ ${#line} -le 80 ] || return 1
|
||||
done <actual
|
||||
IFS=$save_IFS
|
||||
'
|
||||
|
||||
test_expect_success 'Test setup-repo and list-repos.' '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue