Skip to content

Commit

Permalink
notrim
Browse files Browse the repository at this point in the history
  • Loading branch information
lingrino committed Jun 3, 2018
1 parent 09ab1ce commit 2c3b77a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions cmd/flags.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package cmd

// TrimPathPrefix determines if the output paths should have the input path
// trimmed from the prefix
var trimPathPrefix bool
// noTrimPathPrefix determines if the output paths should
// have the input path trimmed from the prefix
var noTrimPathPrefix bool
4 changes: 2 additions & 2 deletions cmd/folder_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var folderListCmd = &cobra.Command{

Run: func(cmd *cobra.Command, args []string) {
input := vaku.NewPathInput(args[0])
input.TrimPathPrefix = trimPathPrefix
input.TrimPathPrefix = !noTrimPathPrefix

output, err := vgc.FolderList(input)
if err != nil {
Expand All @@ -33,5 +33,5 @@ var folderListCmd = &cobra.Command{

func init() {
folderCmd.AddCommand(folderListCmd)
folderListCmd.PersistentFlags().BoolVarP(&trimPathPrefix, "trim-path-prefix", "t", true, "Output paths with the input path trimmed (like Vault CLI)")
folderListCmd.PersistentFlags().BoolVarP(&noTrimPathPrefix, "no-trim-path-prefix", "T", true, "Output full paths instead of paths with the input path trimmed")
}
4 changes: 2 additions & 2 deletions cmd/folder_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var folderReadCmd = &cobra.Command{

Run: func(cmd *cobra.Command, args []string) {
input := vaku.NewPathInput(args[0])
input.TrimPathPrefix = trimPathPrefix
input.TrimPathPrefix = !noTrimPathPrefix

output, err := vgc.FolderRead(input)
if err != nil {
Expand All @@ -31,5 +31,5 @@ var folderReadCmd = &cobra.Command{

func init() {
folderCmd.AddCommand(folderReadCmd)
folderReadCmd.PersistentFlags().BoolVarP(&trimPathPrefix, "trim-path-prefix", "t", true, "Output paths with the input path trimmed (like Vault CLI)")
folderReadCmd.PersistentFlags().BoolVarP(&noTrimPathPrefix, "no-trim-path-prefix", "T", true, "Output full paths instead of paths with the input path trimmed")
}
4 changes: 2 additions & 2 deletions cmd/folder_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var folderSearchCmd = &cobra.Command{

Run: func(cmd *cobra.Command, args []string) {
input := vaku.NewPathInput(args[0])
input.TrimPathPrefix = trimPathPrefix
input.TrimPathPrefix = !noTrimPathPrefix

output, err := vgc.FolderSearch(input, args[1])
if err != nil {
Expand All @@ -31,5 +31,5 @@ var folderSearchCmd = &cobra.Command{

func init() {
folderCmd.AddCommand(folderSearchCmd)
folderSearchCmd.PersistentFlags().BoolVarP(&trimPathPrefix, "trim-path-prefix", "t", true, "Output paths with the input path trimmed (like Vault CLI)")
folderSearchCmd.PersistentFlags().BoolVarP(&noTrimPathPrefix, "no-trim-path-prefix", "T", true, "Output full paths instead of paths with the input path trimmed")
}
4 changes: 2 additions & 2 deletions cmd/path_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var pathListCmd = &cobra.Command{

Run: func(cmd *cobra.Command, args []string) {
input := vaku.NewPathInput(args[0])
input.TrimPathPrefix = trimPathPrefix
input.TrimPathPrefix = !noTrimPathPrefix

output, err := vgc.PathList(input)
if err != nil {
Expand All @@ -31,5 +31,5 @@ var pathListCmd = &cobra.Command{

func init() {
pathCmd.AddCommand(pathListCmd)
pathListCmd.PersistentFlags().BoolVarP(&trimPathPrefix, "trim-path-prefix", "t", true, "Output paths with the input path trimmed (like Vault CLI)")
pathListCmd.PersistentFlags().BoolVarP(&noTrimPathPrefix, "no-trim-path-prefix", "T", true, "Output full paths instead of paths with the input path trimmed")
}

0 comments on commit 2c3b77a

Please sign in to comment.