AutoYADM commit: 2025-05-02 18:30:13
This commit is contained in:
parent
8cbd52976a
commit
1bfabdc386
1 changed files with 25 additions and 0 deletions
25
.config/fish/functions/newrepo.fish
Normal file
25
.config/fish/functions/newrepo.fish
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
function newrepo --argument-names name
|
||||||
|
argparse h/help p/private P/public s/srht g/github a/all -- $argv
|
||||||
|
function help
|
||||||
|
echo Help menu
|
||||||
|
end
|
||||||
|
if set -lq _flag_h || test (count $argv) -eq 0
|
||||||
|
help
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
# check that some visibility is set
|
||||||
|
set -l error_messages
|
||||||
|
if not set -lq _flag_p && not set -lq _flag_P
|
||||||
|
set -a error_messages 'ERROR: Visibility must be either public or private!' \n
|
||||||
|
end
|
||||||
|
# check that a provider is set
|
||||||
|
if not set -lq _flag_a && not set -lq _flag_s && not set -lq _flag_g
|
||||||
|
set -a error_messages 'ERROR: Provider must be set!' \n
|
||||||
|
end
|
||||||
|
if test (count $error_messages) -ne 0
|
||||||
|
echo $error_messages
|
||||||
|
help
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
echo Proceed
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue