From 35105d34bfda3078aec7f44f28f5afb035fd095f Mon Sep 17 00:00:00 2001 From: Neal-C Date: Sat, 26 Oct 2024 20:01:27 +0200 Subject: [PATCH] docs: fixed documentation and added some --- README.md | 8 ++++++++ internal/cli/root.go | 4 ++-- internal/cli/thanos_snap.go | 9 +++------ internal/cli/version.go | 4 ++-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f7b4dc9..26fc32e 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,14 @@ gh ghpm --help gh ghpm thanos_snap ``` +## Only turn 1 repository private + +The github cli already supports turning 1 repository private: https://cli.github.com/manual/gh_repo_edit + +```bash +gh repo edit myusername/myrepository --visibility private +``` + ## Roadmap - [x] switch every repositories to private (excluding repos with >= 1 stars) diff --git a/internal/cli/root.go b/internal/cli/root.go index 5c7d659..37e404d 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -11,10 +11,10 @@ var ( ) var rootCmd = &cobra.Command{ - Use: "ghpm", + Use: "gh ghpm", Short: "ghpm is tool to manage privacy on github.", Args: cobra.ExactArgs(0), - Long: `ghpm is tool to manage privacy on github. And quickly switch all repository to private.`, + Long: `ghpm is tool to manage privacy on github. And quickly switch all repositories to private.`, RunE: func(cmd *cobra.Command, args []string) error { if version { diff --git a/internal/cli/thanos_snap.go b/internal/cli/thanos_snap.go index dec3d83..4a74dc0 100644 --- a/internal/cli/thanos_snap.go +++ b/internal/cli/thanos_snap.go @@ -34,19 +34,16 @@ func Prettyfy(data any) (string, error) { } var thanosSnapCmd = &cobra.Command{ - Use: "thanos_snap", + Use: "gh ghpm thanos_snap", Short: "Switch all your public repositories to private.", Args: cobra.NoArgs, Long: heredoc.Docf(` Switch all your public repositories to private. - By default, starred repositories with 4 starts are not turned private. - - Starts interactive setup and does a HTTP request against all your public repositories to turn them private + By default, starred repositories with 1 stars are not turned private. `, "`"), Example: heredoc.Doc(` - # Starts interactive setup - and request all your public repositories to turn private + # request all your public repositories to turn private, except if they have stars $ ghpm thanos_snap `), diff --git a/internal/cli/version.go b/internal/cli/version.go index eb5d3f1..4328ca3 100644 --- a/internal/cli/version.go +++ b/internal/cli/version.go @@ -6,10 +6,10 @@ import ( "github.com/spf13/cobra" ) -var Version = "v0.1.3" +var Version = "v0.1.4" var versionCmd = &cobra.Command{ - Use: "version", + Use: "gh ghpm version", Short: "Shows the version number of ghpm, then exits.", Run: func(cmd *cobra.Command, args []string) { fmt.Printf("'%s' (linux/amd64, linux/x86_64, linux/arm64, darwin/arm64, darwin/amd64)\n", Version)