diff --git a/dot_config/fish/functions/hack.fish b/dot_config/fish/functions/hack.fish index 83da3c0..e292aa6 100644 --- a/dot_config/fish/functions/hack.fish +++ b/dot_config/fish/functions/hack.fish @@ -1,8 +1,12 @@ #!/usr/bin/env fish -function hack --description "Select a GH repo, [clone it], enter its directory" - set -f repos $(gh repo list --no-archived --json name,description --jq '.[] | "\(.name) \u001b[1;30m\(.description)\u001b[0m"') - set -f repo $(gum filter --height 10 $repos | string split ' ')[1] +function hack --description "Select a GH repo, [clone it], enter its directory" \ + --argument-names repo + if ! set -q repo + set -f repos \ + $(gh repo list --no-archived --json name,description --jq '.[] | "\(.name) \u001b[1;30m\(.description)\u001b[0m"') + set -f repo $(gum filter --height 10 $repos | string split ' ')[1] + end set -f path "$HOME/hackin/$repo"