cmd.go 605 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package cmd
  2. import (
  3. "time"
  4. "github.com/urfave/cli"
  5. )
  6. func stringFlag(name, value, usage string) cli.StringFlag {
  7. return cli.StringFlag{
  8. Name: name,
  9. Value: value,
  10. Usage: usage,
  11. }
  12. }
  13. func boolFlag(name, usage string) cli.BoolFlag {
  14. return cli.BoolFlag{
  15. Name: name,
  16. Usage: usage,
  17. }
  18. }
  19. func intFlag(name string, value int, usage string) cli.IntFlag {
  20. return cli.IntFlag{
  21. Name: name,
  22. Value: value,
  23. Usage: usage,
  24. }
  25. }
  26. func durationFlag(name string, value time.Duration, usage string) cli.DurationFlag {
  27. return cli.DurationFlag{
  28. Name: name,
  29. Value: value,
  30. Usage: usage,
  31. }
  32. }