Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added gzip / gunzip #131

Merged
merged 1 commit into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions carapace/cmd/completers.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import (
git "github.com/rsteube/carapace-bin/completers/git_completer/cmd"
gradle "github.com/rsteube/carapace-bin/completers/gradle_completer/cmd"
grep "github.com/rsteube/carapace-bin/completers/grep_completer/cmd"
gunzip "github.com/rsteube/carapace-bin/completers/gunzip_completer/cmd"
gzip "github.com/rsteube/carapace-bin/completers/gzip_completer/cmd"
head "github.com/rsteube/carapace-bin/completers/head_completer/cmd"
hostid "github.com/rsteube/carapace-bin/completers/hostid_completer/cmd"
id "github.com/rsteube/carapace-bin/completers/id_completer/cmd"
Expand Down Expand Up @@ -129,6 +131,8 @@ var completers = []string{
"git",
"gradle",
"grep",
"gunzip",
"gzip",
"head",
"hostid",
"id",
Expand Down Expand Up @@ -258,6 +262,10 @@ func executeCompleter(completer string) {
gradle.Execute()
case "grep":
grep.Execute()
case "gunzip":
gunzip.Execute()
case "gzip":
gzip.Execute()
case "head":
head.Execute()
case "hostid":
Expand Down
35 changes: 35 additions & 0 deletions completers/gunzip_completer/cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
Use: "gunzip",
Short: "Uncompress files",
Run: func(cmd *cobra.Command, args []string) {},
}

func Execute() error {
return rootCmd.Execute()
}
func init() {
carapace.Gen(rootCmd).Standalone()

rootCmd.Flags().BoolP("force", "f", false, "force overwrite of output file and compress links")
rootCmd.Flags().Bool("help", false, "display this help and exit")
rootCmd.Flags().BoolP("keep", "k", false, "keep (don't delete) input files")
rootCmd.Flags().BoolP("list", "l", false, "list compressed file contents")
rootCmd.Flags().BoolP("name", "N", false, "save or restore the original name and timestamp")
rootCmd.Flags().BoolP("no-name", "n", false, "do not save or restore the original name and timestamp")
rootCmd.Flags().BoolP("quiet", "q", false, "suppress all warnings")
rootCmd.Flags().BoolP("recursive", "r", false, "operate recursively on directories")
rootCmd.Flags().BoolP("stdout", "c", false, "write on standard output, keep original files unchanged")
rootCmd.Flags().StringP("suffix", "S", "", "use suffix SUF on compressed files")
rootCmd.Flags().BoolP("test", "t", false, "test compressed file integrity")
rootCmd.Flags().BoolP("verbose", "v", false, "verbose mode")
rootCmd.Flags().Bool("version", false, "display version information and exit")

carapace.Gen(rootCmd).PositionalAnyCompletion(carapace.ActionFiles(""))
}
7 changes: 7 additions & 0 deletions completers/gunzip_completer/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/rsteube/carapace-bin/completers/gunzip_completer/cmd"

func main() {
cmd.Execute()
}
40 changes: 40 additions & 0 deletions completers/gzip_completer/cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
Use: "gzip",
Short: "Compress or uncompress files",
Run: func(cmd *cobra.Command, args []string) {},
}

func Execute() error {
return rootCmd.Execute()
}
func init() {
carapace.Gen(rootCmd).Standalone()

rootCmd.Flags().BoolP("best", "9", false, "compress better")
rootCmd.Flags().BoolP("decompress", "d", false, "decompress")
rootCmd.Flags().BoolP("fast", "1", false, "compress faster")
rootCmd.Flags().BoolP("force", "f", false, "force overwrite of output file and compress links")
rootCmd.Flags().BoolP("help", "h", false, "give this help")
rootCmd.Flags().BoolP("keep", "k", false, "keep (don't delete) input files")
rootCmd.Flags().BoolP("license", "L", false, "display software license")
rootCmd.Flags().BoolP("list", "l", false, "list compressed file contents")
rootCmd.Flags().BoolP("name", "N", false, "save or restore the original name and timestamp")
rootCmd.Flags().BoolP("no-name", "n", false, "do not save or restore the original name and timestamp")
rootCmd.Flags().BoolP("quiet", "q", false, "suppress all warnings")
rootCmd.Flags().BoolP("recursive", "r", false, "operate recursively on directories")
rootCmd.Flags().Bool("rsyncable", false, "make rsync-friendly archive")
rootCmd.Flags().BoolP("stdout", "c", false, "write on standard output, keep original files unchanged")
rootCmd.Flags().StringP("suffix", "S", "", "use suffix SUF on compressed files")
rootCmd.Flags().BoolP("test", "t", false, "test compressed file integrity")
rootCmd.Flags().BoolP("verbose", "v", false, "verbose mode")
rootCmd.Flags().BoolP("version", "V", false, "display version number")

carapace.Gen(rootCmd).PositionalAnyCompletion(carapace.ActionFiles(""))
}
7 changes: 7 additions & 0 deletions completers/gzip_completer/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/rsteube/carapace-bin/completers/gzip_completer/cmd"

func main() {
cmd.Execute()
}