Skip to content

Commit

Permalink
Remove run command
Browse files Browse the repository at this point in the history
  • Loading branch information
aswinkarthik committed Apr 29, 2018
1 parent f3a8515 commit 143c0b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 162 deletions.
8 changes: 6 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Most suitable for csv files created from database tables`,
// Uncomment the following line if your bare application
// has an action associated with it:
Run: func(cmd *cobra.Command, args []string) {
if !timed {
if timed {
defer timeTrack(time.Now(), "csvdiff")
}

Expand Down Expand Up @@ -103,7 +103,6 @@ func init() {
rootCmd.Flags().IntSliceVarP(&config.PrimaryKeyPositions, "primary-key", "p", []int{0}, "Primary key positions of the Input CSV as comma separated values Eg: 1,2")
rootCmd.Flags().IntSliceVarP(&config.ValueColumnPositions, "columns", "", []int{}, "Selectively compare positions in CSV Eg: 1,2. Default is entire row")

rootCmd.Flags().BoolVarP(&debug, "debug", "", false, "Debug mode")
rootCmd.Flags().BoolVarP(&timed, "time", "", false, "Measure time")
}

Expand Down Expand Up @@ -141,3 +140,8 @@ func newReadCloser(filename string) io.ReadCloser {

return file
}

func timeTrack(start time.Time, name string) {
elapsed := time.Since(start)
fmt.Fprintln(os.Stderr, fmt.Sprintf("%s took %s", name, elapsed))
}
160 changes: 0 additions & 160 deletions cmd/run.go

This file was deleted.

0 comments on commit 143c0b4

Please sign in to comment.