(cmd *cobra.Command)
| 147 | } |
| 148 | |
| 149 | func parseShareLinkCreateOptions(cmd *cobra.Command) (shareLinkCreateOptions, error) { |
| 150 | var opts shareLinkCreateOptions |
| 151 | |
| 152 | if cmd.Flags().Changed("expires") { |
| 153 | expires, err := shareLinkExpiresFlag(cmd) |
| 154 | if err != nil { |
| 155 | return opts, err |
| 156 | } |
| 157 | opts.expires = expires |
| 158 | } |
| 159 | |
| 160 | if cmd.Flags().Changed("remove-expiration") { |
| 161 | removeExpiration, err := cmd.Flags().GetBool("remove-expiration") |
| 162 | if err != nil { |
| 163 | return opts, err |
| 164 | } |
| 165 | opts.removeExpiration = removeExpiration |
| 166 | } |
| 167 | |
| 168 | if cmd.Flags().Changed("allow-download") { |
| 169 | allowDownload, err := cmd.Flags().GetBool("allow-download") |
| 170 | if err != nil { |
| 171 | return opts, err |
| 172 | } |
| 173 | opts.allowDownload = allowDownload |
| 174 | } |
| 175 | |
| 176 | if cmd.Flags().Changed("disallow-download") { |
| 177 | disallowDownload, err := cmd.Flags().GetBool("disallow-download") |
| 178 | if err != nil { |
| 179 | return opts, err |
| 180 | } |
| 181 | opts.disallowDownload = disallowDownload |
| 182 | } |
| 183 | |
| 184 | if cmd.Flags().Changed("access") { |
| 185 | access, err := shareLinkAccessFlag(cmd) |
| 186 | if err != nil { |
| 187 | return opts, err |
| 188 | } |
| 189 | opts.access = access |
| 190 | } |
| 191 | |
| 192 | if cmd.Flags().Changed("audience") { |
| 193 | audience, err := shareLinkAudienceFlag(cmd) |
| 194 | if err != nil { |
| 195 | return opts, err |
| 196 | } |
| 197 | opts.audience = audience |
| 198 | } |
| 199 | |
| 200 | password, err := sharedLinkPasswordFromFlags(cmd) |
| 201 | if err != nil { |
| 202 | return opts, err |
| 203 | } |
| 204 | opts.password = password |
| 205 | |
| 206 | if opts.expires != nil && opts.removeExpiration { |
no test coverage detected