arg.go 548 B

123456789101112131415161718192021222324252627
  1. package flags
  2. import (
  3. "reflect"
  4. )
  5. // Arg represents a positional argument on the command line.
  6. type Arg struct {
  7. // The name of the positional argument (used in the help)
  8. Name string
  9. // A description of the positional argument (used in the help)
  10. Description string
  11. // The minimal number of required positional arguments
  12. Required int
  13. // The maximum number of required positional arguments
  14. RequiredMaximum int
  15. value reflect.Value
  16. tag multiTag
  17. }
  18. func (a *Arg) isRemaining() bool {
  19. return a.value.Type().Kind() == reflect.Slice
  20. }