Skip to content

Commit

Permalink
require ticket string as argument
Browse files Browse the repository at this point in the history
  • Loading branch information
iychoi committed Jan 19, 2023
1 parent 6d945a7 commit 1e3f6cb
Showing 1 changed file with 3 additions and 43 deletions.
46 changes: 3 additions & 43 deletions cmd/subcmd/lsticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,9 @@ func processLsticketCommand(command *cobra.Command, args []string) error {
defer filesystem.Release()

if len(args) == 0 {
err = listTickets(filesystem)
if err != nil {
logger.Error(err)
fmt.Fprintln(os.Stderr, err.Error())
return nil
}
err := fmt.Errorf("not enough input arguments")
logger.Error(err)
fmt.Fprintln(os.Stderr, err.Error())
} else {
for _, ticket := range args {
err = getTicket(filesystem, ticket)
Expand All @@ -80,43 +77,6 @@ func processLsticketCommand(command *cobra.Command, args []string) error {
return nil
}

func listTickets(filesystem *irodsclient_fs.FileSystem) error {
logger := log.WithFields(log.Fields{
"package": "main",
"function": "listTickets",
})

logger.Debug("listing tickets")

/*
// sort by name
sort.SliceStable(objs, func(i int, j int) bool {
return objs[i].Name < objs[j].Name
})
// print data objects first
for _, entry := range objs {
if veryLongFormat {
for _, replica := range entry.Replicas {
modTime := commons.MakeDateTimeString(replica.ModifyTime)
fmt.Printf(" %s\t%d\t%s\t%d\t%s\t&\t%s\n", replica.Owner, replica.Number, replica.ResourceHierarchy, entry.Size, modTime, entry.Name)
fmt.Printf(" %s\t%s\n", replica.CheckSum, replica.Path)
}
} else if longFormat {
for _, replica := range entry.Replicas {
modTime := commons.MakeDateTimeString(replica.ModifyTime)
fmt.Printf(" %s\t%d\t%s\t%d\t%s\t&\t%s\n", replica.Owner, replica.Number, replica.ResourceHierarchy, entry.Size, modTime, entry.Name)
}
} else {
fmt.Printf(" %s\n", entry.Name)
}
}
*/

return nil
}

func getTicket(filesystem *irodsclient_fs.FileSystem, ticket string) error {
logger := log.WithFields(log.Fields{
"package": "main",
Expand Down

0 comments on commit 1e3f6cb

Please sign in to comment.