Closed rsenden closed 1 year ago
Yes this makes sense I will add individual list and get commands. I won't rename it for now and still considering whether this is appropriate :)
From https://github.com/fortify/fcli/issues/362#issuecomment-1649298833:
As for lookup-items, are you saying that this is only useful for the fcli fod rest call command, not any of the other fcli fod
Unfortunately, the lookup-items are just typedefs/enums which are used throughout the API. However I do like the idea of moving it under rest call commands :
fcli fod rest lookup-items list
fcli fod rest lookup-items get --type TechnologyTypes
I don't mind whether its lookup
or lookup-items
that's used. What do you think?
With my question, I meant to ask whether end users would only need these commands for looking up items when using the fcli fod rest call
command, or would they also need to use these commands to understand what input is allowed for certain options on other fcli fod
commands?
I.e., suppose we have an option --technology-type
somewhere, would users need to use these lookup
commands to find out what values can be passed to this option, or does this option use an enum
to define allowed values (and list those allowed values in the option description)?
If the output of the lookup
commands is only relevant when users want to manually invoke API endpoints through the fcli fod rest call
command, then we should move this to functionality to the fcli fod rest
command tree. If the output is also relevant for option values on other commands, we can probably still choose to have this under fcli fod rest
(making it clear to users that these values correspond directly to the FoD REST API values), or keep it as a stand-alone entity; not sure which is better?
Note that we only allow 3 levels of sub-commands, so we can't have fcli fod rest lookup-items list
or fcli fod rest lookup-items get
. Anyway, we could simply have the following, which in this case maybe even looks much more intuitive, without having to bother about lookup
versus lookup-items
:
fcli fod rest lookup <type, default=All>
The output is relevant when using both the REST API directly and other commands, however I like your suggestion:
fcli fod rest lookup <type, default=All>
so will implement this 😃
Implemented
The behavior of the
fcli fod lookup-items list
command isn't very intuitive / somewhat inconsistent with other fcli commands.Apparently,
fcli fod lookup-items list
without parameters lists the lookup items forAll
. To see the details of for example theTimeZones
entry, I'd expect to do something likefcli fod lookup-items get TimeZones
. However, apparently there's noget
command; instead I'd need to dofcli fod lookup-items list --type TimeZones
.This feels inconsistent with other fcli commands. Having a
get
command that outputs a list is also somewhat inconsistent, but still feels more natural. Maybe if we renamelookup-items
to something else (see #362), we can come up with a more natural command structure?