From a46b2d4fb7dee11fcc508c6871b86d9bff8d01ae Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Sun, 28 Apr 2024 12:39:20 +0200 Subject: feat(repo): add repo clean command to remove untracked files This introduces the `pkgctl repo clean` command which removes every untracked files from local package repositories (via `git clean`). The usage is as simple as `pkgctl repo clean [OPTION] [PATH]` (where "[PATH]" can be equal to a wildcard "*"). Component: pkgctl repo clean --- contrib/completion/bash/devtools.in | 7 +++++++ contrib/completion/zsh/_devtools.in | 8 ++++++++ 2 files changed, 15 insertions(+) (limited to 'contrib/completion') diff --git a/contrib/completion/bash/devtools.in b/contrib/completion/bash/devtools.in index 5125ceb..136beef 100644 --- a/contrib/completion/bash/devtools.in +++ b/contrib/completion/bash/devtools.in @@ -292,6 +292,7 @@ _pkgctl_aur_drop_from_repo_opts() { _filedir -d; } _pkgctl_repo_cmds=( + clean clone configure create @@ -317,6 +318,12 @@ _pkgctl_repo_clone_args__jobs_opts() { :; } _pkgctl_repo_clone_args_j_opts() { _pkgctl_repo_clone_args__jobs_opts; } _pkgctl_repo_clone_opts() { _devtools_completions_all_packages; } +_pkgctl_repo_clean_args=( + -i --interactive + -n --dry-run + -h --help +) +_pkgctl_repo_clean_opts() { _filedir -d; } _pkgctl_repo_configure_args=( --protocol diff --git a/contrib/completion/zsh/_devtools.in b/contrib/completion/zsh/_devtools.in index 48ff373..65d7895 100644 --- a/contrib/completion/zsh/_devtools.in +++ b/contrib/completion/zsh/_devtools.in @@ -114,6 +114,7 @@ _pkgctl_aur_drop_from_repo_args=( _pkgctl_repo_cmds=( "pkgctl repo command" + "clean[Remove untracked files from the working tree]" "clone[Clone a package repository]" "configure[Configure a clone according to distro specs]" "create[Create a new GitLab package repository]" @@ -128,6 +129,13 @@ _pkgctl_repo_switch_args=( '*:git_dir:_files -/' ) +_pkgctl_repo_clean_args=( + '(-i --interactive)'{-i,--interactive}'[Show what would be done and clean files interactively]' + '(-n --dry-run)'{-n,--dry-run}"[Don't remove anything, just show what would be done]" + '(-h --help)'{-h,--help}'[Display usage]' + '*:git_dir:_files -/' +) + _pkgctl_repo_clone_args=( '(-m --maintainer=)'{-m,--maintainer=}'[Clone all packages of the named maintainer]:maintainer:' '--protocol[Clone the repository over https]:proto:(https)' -- cgit v1.2.3-70-g09d2