From 1bfabdc38647291a4c06e5c50bf733db5b9b9d5d Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Fri, 2 May 2025 18:30:13 -0400 Subject: [PATCH] AutoYADM commit: 2025-05-02 18:30:13 --- .config/fish/functions/newrepo.fish | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .config/fish/functions/newrepo.fish diff --git a/.config/fish/functions/newrepo.fish b/.config/fish/functions/newrepo.fish new file mode 100644 index 00000000..f68c90bc --- /dev/null +++ b/.config/fish/functions/newrepo.fish @@ -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