Skip to content

Commit

Permalink
Update help message
Browse files Browse the repository at this point in the history
  • Loading branch information
iychoi committed Mar 13, 2023
1 parent 543ee66 commit 564c188
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 28 deletions.
12 changes: 6 additions & 6 deletions cmd/subcmd/bput.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ func AddBputCommand(rootCmd *cobra.Command) {
bputCmd.Flags().MarkHidden("force")
bputCmd.Flags().Bool("clear_leftover", false, "Clear leftover bundle files")
bputCmd.Flags().Int("max_file_num", commons.MaxBundleFileNumDefault, "Specify max file number in a bundle file")
bputCmd.Flags().String("max_file_size", strconv.FormatInt(commons.MaxBundleFileSizeDefault, 10), "Specify max file size of a bundle file (default is 2GB)")
bputCmd.Flags().Int("upload_thread_num", commons.UploadTreadNumDefault, "Specify the number of upload threads (default is 5)")
bputCmd.Flags().String("tcp_buffer_size", strconv.Itoa(commons.TcpBufferSizeDefault), "Specify TCP socket buffer size (default is 4MB)")
bputCmd.Flags().String("max_file_size", strconv.FormatInt(commons.MaxBundleFileSizeDefault, 10), "Specify max file size of a bundle file")
bputCmd.Flags().Int("upload_thread_num", commons.UploadTreadNumDefault, "Specify the number of upload threads")
bputCmd.Flags().String("tcp_buffer_size", commons.TcpBufferSizeStringDefault, "Specify TCP socket buffer size")
bputCmd.Flags().Bool("progress", false, "Display progress bars")
bputCmd.Flags().String("local_temp", os.TempDir(), "Specify local temp directory path to create bundle files")
bputCmd.Flags().String("irods_temp", "", "Specify iRODS temp directory path to upload bundle files to")
bputCmd.Flags().Bool("diff", false, "Put files having different content")
bputCmd.Flags().Bool("no_hash", false, "Compare files without using md5 hash")
bputCmd.Flags().Bool("no_replication", false, "Disable replication (default is False)")
bputCmd.Flags().Int("retry", 1, "Retry if fails (default is 1)")
bputCmd.Flags().Int("retry_interval", 60, "Retry interval in seconds (default is 60)")
bputCmd.Flags().Bool("no_replication", false, "Disable replication")
bputCmd.Flags().Int("retry", 1, "Retry if fails")
bputCmd.Flags().Int("retry_interval", 60, "Retry interval in seconds")

rootCmd.AddCommand(bputCmd)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/subcmd/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ func AddCpCommand(rootCmd *cobra.Command) {
cpCmd.Flags().Bool("progress", false, "Display progress bars")
cpCmd.Flags().Bool("diff", false, "Copy files having different content")
cpCmd.Flags().Bool("no_hash", false, "Compare files without using md5 hash")
cpCmd.Flags().Int("retry", 1, "Retry if fails (default is 1)")
cpCmd.Flags().Int("retry_interval", 60, "Retry interval in seconds (default is 60)")
cpCmd.Flags().Int("retry", 1, "Retry if fails")
cpCmd.Flags().Int("retry_interval", 60, "Retry interval in seconds")

rootCmd.AddCommand(cpCmd)
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/subcmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ func AddGetCommand(rootCmd *cobra.Command) {
commons.SetCommonFlags(getCmd)

getCmd.Flags().BoolP("force", "f", false, "Get forcefully")
getCmd.Flags().Int("download_thread_num", commons.MaxParallelJobThreadNumDefault, "Specify the number of download threads (default is 5)")
getCmd.Flags().String("tcp_buffer_size", strconv.Itoa(commons.TcpBufferSizeDefault), "Specify TCP socket buffer size (default is 4MB)")
getCmd.Flags().Int("download_thread_num", commons.MaxParallelJobThreadNumDefault, "Specify the number of download threads")
getCmd.Flags().String("tcp_buffer_size", commons.TcpBufferSizeStringDefault, "Specify TCP socket buffer size")
getCmd.Flags().Bool("progress", false, "Display progress bar")
getCmd.Flags().Bool("diff", false, "Get files having different content")
getCmd.Flags().Bool("no_hash", false, "Compare files without using md5 hash")
getCmd.Flags().Int("retry", 1, "Retry if fails (default is 1)")
getCmd.Flags().Int("retry_interval", 60, "Retry interval in seconds (default is 60)")
getCmd.Flags().Int("retry", 1, "Retry if fails")
getCmd.Flags().Int("retry_interval", 60, "Retry interval in seconds")

rootCmd.AddCommand(getCmd)
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/subcmd/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ func AddPutCommand(rootCmd *cobra.Command) {
commons.SetCommonFlags(putCmd)

putCmd.Flags().BoolP("force", "f", false, "Put forcefully")
putCmd.Flags().Int("upload_thread_num", commons.MaxParallelJobThreadNumDefault, "Specify the number of upload threads (default is 5)")
putCmd.Flags().String("tcp_buffer_size", strconv.Itoa(commons.TcpBufferSizeDefault), "Specify TCP socket buffer size (default is 4MB)")
putCmd.Flags().Int("upload_thread_num", commons.MaxParallelJobThreadNumDefault, "Specify the number of upload threads")
putCmd.Flags().String("tcp_buffer_size", commons.TcpBufferSizeStringDefault, "Specify TCP socket buffer size")
putCmd.Flags().Bool("progress", false, "Display progress bar")
putCmd.Flags().Bool("diff", false, "Put files having different content")
putCmd.Flags().Bool("no_hash", false, "Compare files without using md5 hash")
putCmd.Flags().Bool("no_replication", false, "Disable replication (default is False)")
putCmd.Flags().Int("retry", 1, "Retry if fails (default is 1)")
putCmd.Flags().Int("retry_interval", 60, "Retry interval in seconds (default is 60)")
putCmd.Flags().Bool("no_replication", false, "Disable replication")
putCmd.Flags().Int("retry", 1, "Retry if fails")
putCmd.Flags().Int("retry_interval", 60, "Retry interval in seconds")

rootCmd.AddCommand(putCmd)
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/subcmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ func AddSyncCommand(rootCmd *cobra.Command) {
syncCmd.Flags().String("max_file_size", strconv.FormatInt(commons.MaxBundleFileSizeDefault, 10), "Specify max file size of a bundle file")
syncCmd.Flags().Int("upload_thread_num", commons.UploadTreadNumDefault, "Specify the number of upload threads")
syncCmd.Flags().Int("download_thread_num", commons.MaxParallelJobThreadNumDefault, "Specify the number of download threads")
syncCmd.Flags().String("tcp_buffer_size", strconv.Itoa(commons.TcpBufferSizeDefault), "Specify TCP socket buffer size (default is 4MB)")
syncCmd.Flags().String("tcp_buffer_size", commons.TcpBufferSizeStringDefault, "Specify TCP socket buffer size")
syncCmd.Flags().Bool("progress", false, "Display progress bar")
syncCmd.Flags().String("local_temp", os.TempDir(), "Specify local temp directory path to create bundle files")
syncCmd.Flags().String("irods_temp", "", "Specify iRODS temp directory path to upload bundle files to")
syncCmd.Flags().Bool("no_hash", false, "Compare files without using md5 hash")
syncCmd.Flags().Bool("no_replication", false, "Disable replication (default is False)")
syncCmd.Flags().Int("retry", 1, "Retry if fails (default is 1)")
syncCmd.Flags().Int("retry_interval", 60, "Retry interval in seconds (default is 60)")
syncCmd.Flags().Bool("no_replication", false, "Disable replication")
syncCmd.Flags().Int("retry", 1, "Retry if fails")
syncCmd.Flags().Int("retry_interval", 60, "Retry interval in seconds")

rootCmd.AddCommand(syncCmd)
}
Expand Down
8 changes: 4 additions & 4 deletions commons/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ func SetCWD(cwd string) {
}

func SetCommonFlags(command *cobra.Command) {
command.Flags().StringP("config", "c", "", "Set config file or dir (default is $HOME/.irods)")
command.Flags().StringP("config", "c", "", "Set config file or dir (default \"$HOME/.irods\")")
command.Flags().BoolP("envconfig", "e", false, "Read config from environmental variables")
command.Flags().BoolP("version", "v", false, "Print version")
command.Flags().BoolP("help", "h", false, "Print help")
command.Flags().BoolP("debug", "d", false, "Enable debug mode (default is False)")
command.Flags().String("log_level", "", "Set log level (default is INFO)")
command.Flags().BoolP("debug", "d", false, "Enable debug mode")
command.Flags().String("log_level", "", "Set log level")
command.Flags().Int32P("session", "s", -1, "Set session ID")
command.Flags().StringP("resource", "R", "", "Set resource server (default is empty)")
command.Flags().StringP("resource", "R", "", "Set resource server")
command.Flags().StringP("ticket", "T", "", "Set ticket")

// this is hidden
Expand Down
7 changes: 4 additions & 3 deletions commons/constant.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package commons

const (
UploadTreadNumDefault int = 5
UploadTreadNumMax int = 20
TcpBufferSizeDefault int = 4 * 1024 * 1024
UploadTreadNumDefault int = 5
UploadTreadNumMax int = 20
TcpBufferSizeDefault int = 4 * 1024 * 1024
TcpBufferSizeStringDefault string = "4MB"
)

0 comments on commit 564c188

Please sign in to comment.