github.com/fastly/cli@v1.7.2-0.20240304164155-9d0f1d77c3bf/pkg/argparser/common.go (about)

     1  package argparser
     2  
     3  var (
     4  	// FlagCustomerIDName is the flag name.
     5  	FlagCustomerIDName = "customer-id"
     6  	// FlagCustomerIDDesc is the flag description.
     7  	FlagCustomerIDDesc = "Alphanumeric string identifying the customer (falls back to FASTLY_CUSTOMER_ID)"
     8  	// FlagJSONName is the flag name.
     9  	FlagJSONName = "json"
    10  	// FlagJSONDesc is the flag description.
    11  	FlagJSONDesc = "Render output as JSON"
    12  	// FlagServiceIDName is the flag name.
    13  	FlagServiceIDName = "service-id"
    14  	// FlagServiceIDDesc is the flag description.
    15  	FlagServiceIDDesc = "Service ID (falls back to FASTLY_SERVICE_ID, then fastly.toml)"
    16  	// FlagServiceName is the flag name.
    17  	FlagServiceName = "service-name"
    18  	// FlagServiceDesc is the flag description.
    19  	FlagServiceDesc = "The name of the service"
    20  	// FlagVersionName is the flag name.
    21  	FlagVersionName = "version"
    22  	// FlagVersionDesc is the flag description.
    23  	FlagVersionDesc = "'latest', 'active', or the number of a specific Fastly service version"
    24  )
    25  
    26  // PaginationDirection is a list of directions the page results can be displayed.
    27  var PaginationDirection = []string{"ascend", "descend"}
    28  
    29  // CursorFlag returns a cursor flag definition.
    30  func CursorFlag(dst *string) StringFlagOpts {
    31  	return StringFlagOpts{
    32  		Name:        "cursor",
    33  		Short:       'c',
    34  		Description: "Pagination cursor (Use 'next_cursor' value from list output)",
    35  		Dst:         dst,
    36  	}
    37  }
    38  
    39  // LimitFlag returns a limit flag definition.
    40  func LimitFlag(dst *int) IntFlagOpts {
    41  	return IntFlagOpts{
    42  		Name:        "limit",
    43  		Short:       'l',
    44  		Description: "Maximum number of items to list",
    45  		Default:     50,
    46  		Dst:         dst,
    47  	}
    48  }
    49  
    50  // StoreIDFlag returns a store-id flag definition.
    51  func StoreIDFlag(dst *string) StringFlagOpts {
    52  	return StringFlagOpts{
    53  		Name:        "store-id",
    54  		Short:       's',
    55  		Description: "Store ID",
    56  		Dst:         dst,
    57  		Required:    true,
    58  	}
    59  }